Skip to content

Commit 6187585

Browse files
junwang-noaaDan Holdaway
and
Dan Holdaway
authored
add GFSv16 dzmin change and changes for Dev/jcsda (#44)
* add GFSv16 dzmin change * Add code changes in external_ic.F90 and fv_grid_tools.F90 for dev/jcsda, dycore PR #35 Co-authored-by: Jun Wang <junwang-noaa@users.noreply.github.com> Co-authored-by: Dan Holdaway <dan.holdaway@nasa.govr>
1 parent f06c176 commit 6187585

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

model/nh_utils.F90

+11-11
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ module nh_utils_mod
6666
public sim3p0_solver, rim_2d
6767
public Riem_Solver_c
6868

69-
real, parameter:: dz_min = 2.
69+
real, parameter:: dz_min = 6.
7070
real, parameter:: r3 = 1./3.
7171

7272
CONTAINS
@@ -198,14 +198,14 @@ subroutine update_dz_c(is, ie, js, je, km, ng, dt, dp0, zs, area, ut, vt, gz, ws
198198
! Enforce monotonicity of height to prevent blowup
199199
!$OMP parallel do default(none) shared(is1,ie1,js1,je1,ws,zs,gz,rdt,km)
200200
do j=js1, je1
201-
do i=is1, ie1
202-
ws(i,j) = ( zs(i,j) - gz(i,j,km+1) ) * rdt
203-
enddo
204-
do k=km, 1, -1
201+
do k=2, km+1
205202
do i=is1, ie1
206-
gz(i,j,k) = max( gz(i,j,k), gz(i,j,k+1) + dz_min )
203+
gz(i,j,k) = min( gz(i,j,k), gz(i,j,k-1) - dz_min )
207204
enddo
208205
enddo
206+
do i=is1, ie1
207+
ws(i,j) = ( zs(i,j) - gz(i,j,km+1) ) * rdt
208+
enddo
209209
enddo
210210

211211
end subroutine update_dz_c
@@ -312,15 +312,15 @@ subroutine update_dz_d(ndif, damp, hord, is, ie, js, je, km, ng, npx, npy, area,
312312

313313
!$OMP parallel do default(none) shared(is,ie,js,je,km,ws,zs,zh,rdt)
314314
do j=js, je
315-
do i=is,ie
316-
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
317-
enddo
318-
do k=km, 1, -1
315+
do k=2, km+1
319316
do i=is, ie
320317
! Enforce monotonicity of height to prevent blowup
321-
zh(i,j,k) = max( zh(i,j,k), zh(i,j,k+1) + dz_min )
318+
zh(i,j,k) = min( zh(i,j,k), zh(i,j,k-1) - dz_min )
322319
enddo
323320
enddo
321+
do i=is,ie
322+
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
323+
enddo
324324
enddo
325325

326326
end subroutine update_dz_d

tools/external_ic.F90

+5-8
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module external_ic_mod
148148
use external_sst_mod, only: i_sst, j_sst, sst_ncep
149149
use fms_mod, only: file_exist, read_data, field_exist, write_version_number
150150
use fms_mod, only: open_namelist_file, check_nml_error, close_file
151-
use fms_mod, only: get_mosaic_tile_file, read_data, error_mesg
151+
use fms_mod, only: get_mosaic_tile_file, error_mesg
152152
use fms_io_mod, only: get_tile_string, field_size, free_restart_type
153153
use fms_io_mod, only: restart_file_type, register_restart_field
154154
use fms_io_mod, only: save_restart, restore_state, set_filename_appendix, get_global_att_value
@@ -197,10 +197,11 @@ module external_ic_mod
197197

198198
real, parameter:: zvir = rvgas/rdgas - 1.
199199
real(kind=R_GRID), parameter :: cnst_0p20=0.20d0
200-
real :: deg2rad
201-
character (len = 80) :: source ! This tells what the input source was for the data
200+
real, parameter :: deg2rad = pi/180.
201+
character (len = 80),public :: source ! This tells what the input source was for the data
202202
character(len=27), parameter :: source_fv3gfs = 'FV3GFS GAUSSIAN NEMSIO FILE'
203-
public get_external_ic, get_cubed_sphere_terrain
203+
public get_external_ic, get_cubed_sphere_terrain
204+
public remap_scalar, remap_dwinds
204205

205206
! version number of this module
206207
! Include variable "version" to be written to log file.
@@ -999,8 +1000,6 @@ subroutine get_ncep_ic( Atm, fv_domain, nq )
9991000
jsd = Atm%bd%jsd
10001001
jed = Atm%bd%jed
10011002

1002-
deg2rad = pi/180.
1003-
10041003
npz = Atm%npz
10051004
call get_number_tracers(MODEL_ATMOS, num_tracers=ntracers, num_prog=ntprog)
10061005
if(is_master()) write(*,*) 'ntracers = ', ntracers, 'ntprog = ',ntprog
@@ -1564,8 +1563,6 @@ subroutine get_ecmwf_ic( Atm, fv_domain )
15641563
jsd = Atm%bd%jsd
15651564
jed = Atm%bd%jed
15661565

1567-
deg2rad = pi/180.
1568-
15691566
npz = Atm%npz
15701567
call get_number_tracers(MODEL_ATMOS, num_tracers=ntracers, num_prog=ntprog)
15711568
if(is_master()) write(*,*) 'ntracers = ', ntracers, 'ntprog = ',ntprog

tools/fv_grid_tools.F90

+4-4
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ subroutine init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions,
629629

630630
if (Atm%neststruct%nested .or. ANY(Atm%neststruct%child_grids)) then
631631
grid_global => Atm%grid_global
632-
else if( trim(grid_file) .NE. 'INPUT/grid_spec.nc') then
632+
else if( trim(grid_file) .EQ. 'Inline') then
633633
allocate(grid_global(1-ng:npx +ng,1-ng:npy +ng,ndims,1:nregions))
634634
endif
635635

@@ -683,7 +683,7 @@ subroutine init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions,
683683
! still need to set up
684684
call setup_aligned_nest(Atm)
685685
else
686-
if(trim(grid_file) == 'INPUT/grid_spec.nc') then
686+
if(trim(grid_file) .NE. 'Inline') then
687687
call read_grid(Atm, grid_file, ndims, nregions, ng)
688688
else
689689
if (Atm%flagstruct%grid_type>=0) call gnomonic_grids(Atm%flagstruct%grid_type, npx-1, xs, ys)
@@ -1180,8 +1180,8 @@ subroutine init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions,
11801180
enddo
11811181

11821182
if (Atm%neststruct%nested .or. ANY(Atm%neststruct%child_grids)) then
1183-
nullify(grid_global)
1184-
else if( trim(grid_file) .NE. 'INPUT/grid_spec.nc') then
1183+
nullify(grid_global)
1184+
else if( trim(grid_file) .EQ. 'Inline') then
11851185
deallocate(grid_global)
11861186
endif
11871187

0 commit comments

Comments
 (0)