Skip to content

Commit

Permalink
Update chgres_cube to output netcdf4 file. (#704)
Browse files Browse the repository at this point in the history
Previously, the coldstart files were netcdf4-classic.

Fixes #689.
  • Loading branch information
GeorgeGayno-NOAA authored Oct 20, 2022
1 parent b67f487 commit 1817f1d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions sorc/chgres_cube.fd/write_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ subroutine write_fv3_atm_header_netcdf(localpet)

character(len=13) :: outfile

integer :: fsize=65536, initial = 0
integer :: header_buffer_val = 16384
integer :: error, ncid, dim_nvcoord
integer :: dim_levp1, id_ntrac, id_vcoord
Expand All @@ -55,8 +54,7 @@ subroutine write_fv3_atm_header_netcdf(localpet)

print*,"- WRITE ATMOSPHERIC HEADER FILE: ", trim(outfile)

error = nf90_create(outfile, IOR(NF90_NETCDF4,NF90_CLASSIC_MODEL), &
ncid, initialsize=initial, chunksize=fsize)
error = nf90_create(outfile, NF90_NETCDF4, ncid)
call netcdf_err(error, 'CREATING FILE='//trim(outfile) )

error = nf90_def_dim(ncid, 'nvcoord', nvcoord_target, dim_nvcoord)
Expand Down Expand Up @@ -135,7 +133,6 @@ subroutine write_fv3_atm_bndy_data_netcdf(localpet)

character(len=50) :: name

integer :: fsize=65536, initial = 0
integer :: header_buffer_val = 16384
integer :: ncid, error, tile, i, n
integer :: dim_lon, dim_lat
Expand Down Expand Up @@ -207,8 +204,7 @@ subroutine write_fv3_atm_bndy_data_netcdf(localpet)
if (localpet == 0) then

!--- open the file
error = nf90_create("./gfs.bndy.nc", IOR(NF90_NETCDF4,NF90_CLASSIC_MODEL), &
ncid, initialsize=initial, chunksize=fsize)
error = nf90_create("./gfs.bndy.nc", NF90_NETCDF4, ncid)
call netcdf_err(error, 'CREATING BNDY FILE' )

error = nf90_def_dim(ncid, 'lon', i_target, dim_lon)
Expand Down Expand Up @@ -1231,7 +1227,6 @@ subroutine write_fv3_atm_data_netcdf(localpet)
character(len=128) :: outfile

integer :: error, ncid, tile, n
integer :: fsize=65536, initial = 0
integer :: header_buffer_val = 16384
integer :: dim_lon, dim_lat
integer :: dim_lonp, dim_latp
Expand Down Expand Up @@ -1289,8 +1284,7 @@ subroutine write_fv3_atm_data_netcdf(localpet)
endif

!--- open the file
error = nf90_create(outfile, IOR(NF90_NETCDF4,NF90_CLASSIC_MODEL), &
ncid, initialsize=initial, chunksize=fsize)
error = nf90_create(outfile, NF90_NETCDF4, ncid)
call netcdf_err(error, 'CREATING FILE='//trim(outfile) )

!--- define dimension
Expand Down Expand Up @@ -1875,7 +1869,6 @@ subroutine write_fv3_sfc_data_netcdf(localpet)
integer, intent(in) :: localpet
character(len=128) :: outfile

integer :: fsize=65536, initial = 0
integer :: header_buffer_val = 16384
integer :: dim_x, dim_y, dim_lsoil, dim_time
integer :: error, i, ncid, tile
Expand Down Expand Up @@ -1967,8 +1960,7 @@ subroutine write_fv3_sfc_data_netcdf(localpet)
endif

!--- open the file
error = nf90_create(outfile, IOR(NF90_NETCDF4,NF90_CLASSIC_MODEL), &
ncid, initialsize=initial, chunksize=fsize)
error = nf90_create(outfile, NF90_NETCDF4, ncid)
call netcdf_err(error, 'CREATING FILE='//trim(outfile) )

!--- define dimensions
Expand Down

0 comments on commit 1817f1d

Please sign in to comment.