Skip to content

Commit

Permalink
add GFSv16 dzmin change and changes for Dev/jcsda (NOAA-EMC#44)
Browse files Browse the repository at this point in the history
* add GFSv16 dzmin change
* Add code changes in external_ic.F90 and fv_grid_tools.F90 for dev/jcsda, dycore PR NOAA-EMC#35

Co-authored-by: Jun Wang <[email protected]>
Co-authored-by: Dan Holdaway <[email protected]>
  • Loading branch information
3 people committed Nov 17, 2020
1 parent f06c176 commit 6187585
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 23 deletions.
22 changes: 11 additions & 11 deletions model/nh_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module nh_utils_mod
public sim3p0_solver, rim_2d
public Riem_Solver_c

real, parameter:: dz_min = 2.
real, parameter:: dz_min = 6.
real, parameter:: r3 = 1./3.

CONTAINS
Expand Down Expand Up @@ -198,14 +198,14 @@ subroutine update_dz_c(is, ie, js, je, km, ng, dt, dp0, zs, area, ut, vt, gz, ws
! Enforce monotonicity of height to prevent blowup
!$OMP parallel do default(none) shared(is1,ie1,js1,je1,ws,zs,gz,rdt,km)
do j=js1, je1
do i=is1, ie1
ws(i,j) = ( zs(i,j) - gz(i,j,km+1) ) * rdt
enddo
do k=km, 1, -1
do k=2, km+1
do i=is1, ie1
gz(i,j,k) = max( gz(i,j,k), gz(i,j,k+1) + dz_min )
gz(i,j,k) = min( gz(i,j,k), gz(i,j,k-1) - dz_min )
enddo
enddo
do i=is1, ie1
ws(i,j) = ( zs(i,j) - gz(i,j,km+1) ) * rdt
enddo
enddo

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

!$OMP parallel do default(none) shared(is,ie,js,je,km,ws,zs,zh,rdt)
do j=js, je
do i=is,ie
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
enddo
do k=km, 1, -1
do k=2, km+1
do i=is, ie
! Enforce monotonicity of height to prevent blowup
zh(i,j,k) = max( zh(i,j,k), zh(i,j,k+1) + dz_min )
zh(i,j,k) = min( zh(i,j,k), zh(i,j,k-1) - dz_min )
enddo
enddo
do i=is,ie
ws(i,j) = ( zs(i,j) - zh(i,j,km+1) ) * rdt
enddo
enddo

end subroutine update_dz_d
Expand Down
13 changes: 5 additions & 8 deletions tools/external_ic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module external_ic_mod
use external_sst_mod, only: i_sst, j_sst, sst_ncep
use fms_mod, only: file_exist, read_data, field_exist, write_version_number
use fms_mod, only: open_namelist_file, check_nml_error, close_file
use fms_mod, only: get_mosaic_tile_file, read_data, error_mesg
use fms_mod, only: get_mosaic_tile_file, error_mesg
use fms_io_mod, only: get_tile_string, field_size, free_restart_type
use fms_io_mod, only: restart_file_type, register_restart_field
use fms_io_mod, only: save_restart, restore_state, set_filename_appendix, get_global_att_value
Expand Down Expand Up @@ -197,10 +197,11 @@ module external_ic_mod

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

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

deg2rad = pi/180.

npz = Atm%npz
call get_number_tracers(MODEL_ATMOS, num_tracers=ntracers, num_prog=ntprog)
if(is_master()) write(*,*) 'ntracers = ', ntracers, 'ntprog = ',ntprog
Expand Down Expand Up @@ -1564,8 +1563,6 @@ subroutine get_ecmwf_ic( Atm, fv_domain )
jsd = Atm%bd%jsd
jed = Atm%bd%jed

deg2rad = pi/180.

npz = Atm%npz
call get_number_tracers(MODEL_ATMOS, num_tracers=ntracers, num_prog=ntprog)
if(is_master()) write(*,*) 'ntracers = ', ntracers, 'ntprog = ',ntprog
Expand Down
8 changes: 4 additions & 4 deletions tools/fv_grid_tools.F90
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ subroutine init_grid(Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions,

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

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

if (Atm%neststruct%nested .or. ANY(Atm%neststruct%child_grids)) then
nullify(grid_global)
else if( trim(grid_file) .NE. 'INPUT/grid_spec.nc') then
nullify(grid_global)
else if( trim(grid_file) .EQ. 'Inline') then
deallocate(grid_global)
endif

Expand Down

0 comments on commit 6187585

Please sign in to comment.