Skip to content

Commit

Permalink
Updates to use FMS 2021.03 (NCAR#374)
Browse files Browse the repository at this point in the history
* io/FV3GFS_io.F90 updated to use fms2_io
* atmos_model.F90 and ccpp/data/GFS_typefs.F90 updates to input_nml_file handling
* atmos_cubed_sphere submodule updated
  • Loading branch information
bensonr committed Aug 25, 2021
1 parent 862fe80 commit 2dc03c1
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 224 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ list(APPEND _fv3dycore_defs_private SPMD
GFS_TYPES
USE_GFSL63
MOIST_CAPPA
INTERNAL_FILE_NML
ENABLE_QUAD_PRECISION
USE_COND)

if(MULTI_GASES)
Expand Down
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
2 changes: 2 additions & 0 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,8 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
Init_parm%hydrostatic = Atm(mygrid)%flagstruct%hydrostatic

#ifdef INTERNAL_FILE_NML
! allocate required to work around GNU compiler bug 100886 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100886
allocate(Init_parm%input_nml_file, mold=input_nml_file)
Init_parm%input_nml_file => input_nml_file
Init_parm%fn_nml='using internal file'
#else
Expand Down
14 changes: 8 additions & 6 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ module GFS_typedefs
character(len=32), pointer :: tracer_names(:) !< tracers names to dereference tracer id
integer, pointer :: tracer_types(:) !< tracers types: 0=generic, 1=chem,prog, 2=chem,diag
character(len=64) :: fn_nml !< namelist filename
character(len=256), pointer :: input_nml_file(:) !< character string containing full namelist
!< for use with internal file reads
end type GFS_init_type
character(len=:), pointer, dimension(:) :: input_nml_file => null() !< character string containing full namelist
!< for use with internal file reads
end type GFS_init_type


!----------------------------------------------------------------
Expand Down Expand Up @@ -586,8 +586,8 @@ module GFS_typedefs
integer :: nthreads !< OpenMP threads available for physics
integer :: nlunit !< unit for namelist
character(len=64) :: fn_nml !< namelist filename for surface data cycling
character(len=256), pointer :: input_nml_file(:) !< character string containing full namelist
!< for use with internal file reads
character(len=:), pointer, dimension(:) :: input_nml_file => null() !< character string containing full namelist
!< for use with internal file reads
integer :: input_nml_file_length !< length (number of lines) in namelist for internal reads
integer :: logunit
real(kind=kind_phys) :: fhzero !< hours between clearing of diagnostic buckets
Expand Down Expand Up @@ -3086,7 +3086,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer, intent(in) :: nwat
character(len=32), intent(in) :: tracer_names(:)
integer, intent(in) :: tracer_types(:)
character(len=256), intent(in), pointer :: input_nml_file(:)
character(len=:), intent(in), dimension(:), pointer :: input_nml_file
integer, intent(in) :: blksz(:)
real(kind=kind_phys), dimension(:), intent(in) :: ak
real(kind=kind_phys), dimension(:), intent(in) :: bk
Expand Down Expand Up @@ -3723,6 +3723,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

!--- read in the namelist
#ifdef INTERNAL_FILE_NML
! allocate required to work around GNU compiler bug 100886 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100886
allocate(Model%input_nml_file, mold=input_nml_file)
Model%input_nml_file => input_nml_file
read(Model%input_nml_file, nml=gfs_physics_nml)
! Set length (number of lines) in namelist for internal reads
Expand Down
Loading

0 comments on commit 2dc03c1

Please sign in to comment.