Skip to content

Commit

Permalink
Fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaweiZhuang committed Jan 30, 2018
1 parent 61e3654 commit 1260e8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build_library/NetCDF_test/simple_xy_wr.f
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ program simple_xy_wr

C This is the name of the data file we will create.
character*(*) FILE_NAME
parameter (FILE_NAME='simple_xy.nc')
parameter (FILE_NAME='simple_xy_f77.nc')

C We are writing 2D data, a 6 x 12 grid.
integer NDIMS
Expand Down Expand Up @@ -91,7 +91,7 @@ program simple_xy_wr
retval = nf_close(ncid)
if (retval .ne. nf_noerr) call handle_err(retval)

print *,'*** SUCCESS writing example file simple_xy.nc!'
print *,'*** SUCCESS writing example file simple_xy_f77.nc!'
end

subroutine handle_err(errcode)
Expand Down
4 changes: 2 additions & 2 deletions build_library/NetCDF_test/simple_xy_wr.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ program simple_xy_wr
implicit none

! This is the name of the data file we will create.
character (len = *), parameter :: FILE_NAME = "simple_xy.nc"
character (len = *), parameter :: FILE_NAME = "simple_xy_f90.nc"

! We are writing 2D data, a 6 x 12 grid.
integer, parameter :: NDIMS = 2
Expand Down Expand Up @@ -80,7 +80,7 @@ program simple_xy_wr
! associated with the file, and flushes any buffers.
call check( nf90_close(ncid) )

print *, "*** SUCCESS writing example file simple_xy.nc! "
print *, "*** SUCCESS writing example file simple_xy_f90.nc! "

contains
subroutine check(status)
Expand Down
8 changes: 5 additions & 3 deletions build_library/NetCDF_test/test_nc.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#!/bin/bash
# -L/usr/lib can be omiited

gfortran -o write_nc_f90.exe simple_xr_wr.f90 -I/usr/include -lnetcdff
# -L/usr/lib can be omiited
gfortran simple_xr_wr.f90 -o write_nc_f90.exe -I/usr/include -lnetcdff
./write_nc_f90.exe
ncdump -h simple_xy_f90.nc

gfortran -o write_nc_f77.exe simple_xr_wr.f -I/usr/include -lnetcdff
gfortran simple_xr_wr.f -o write_nc_f77.exe -I/usr/include -lnetcdff
./write_nc_f77.exe
ncdump -h simple_xy_f77.nc

0 comments on commit 1260e8a

Please sign in to comment.