Skip to content

Commit

Permalink
Porting MOM5 to latest FMS (ulm)
Browse files Browse the repository at this point in the history
This is a large patch which updates MOM5 to use the latest FMS library.

Based on the following FMS release:

url: https://github.com/NOAA-GFDL/FMS.git
commit: 35e491c497d4bb9b77bd6d8b9557badd53e56e19

Modifications to the `load_xgrid` subroutine of `xgrid.F90` (already
present in the MOM5 source) have been integrated into this FMS release.

Changes to FMS are not summarised here, only changes to MOM and support
models (atmos, land, sis) are summarised below.

Changes are as follows:

- Updating the FMS (src/shared) library to the latest FMS release.

- `write_version_number` updated in each module to support inputs

- `version` and `tagname` variable names are now used consistently
  across modules

- The `land_null` model now sets its `Current_domain` to support changes
  to `get_mosaic_xgrid` (which now requires an explicit domain)

- FMS_compile.csh buildscript replaces the fixed filepaths with an
  autogenerated list using the `list_paths` utility

The main purpose of this patch is to demonstrate that MOM5 still runs
under the newer FMS release with only minor changes, and to start
discussion of how to maintain MOM under future FMS releases.
  • Loading branch information
marshallward committed Mar 16, 2016
1 parent c3a5fef commit 5f70c21
Show file tree
Hide file tree
Showing 461 changed files with 15,293 additions and 8,151 deletions.
93 changes: 2 additions & 91 deletions exp/FMS_compile.csh
Original file line number Diff line number Diff line change
Expand Up @@ -3,97 +3,8 @@

set pathnames_shared = $code_dir/path_names_shared # path to file containing list of source paths

cat > $pathnames_shared <<EOF_shared
shared/drifters/cloud_interpolator.F90
shared/drifters/drifters.F90
shared/drifters/drifters_comm.F90
shared/drifters/drifters_compute_k.h
shared/drifters/drifters_core.F90
shared/drifters/drifters_input.F90
shared/drifters/drifters_io.F90
shared/drifters/drifters_push.h
shared/drifters/drifters_set_field.h
shared/drifters/fms_switches.h
shared/drifters/quicksort.F90
shared/exchange/stock_constants.F90
shared/exchange/xgrid.F90
shared/fms/fms.F90
shared/fms/fms_io.F90
shared/fms/read_data_2d.inc
shared/fms/read_data_3d.inc
shared/fms/read_data_4d.inc
shared/fms/write_data.inc
shared/mpp/mpp.F90
shared/mpp/mpp_data.F90
shared/mpp/mpp_domains.F90
shared/mpp/mpp_io.F90
shared/mpp/mpp_memutils.F90
shared/mpp/mpp_parameter.F90
shared/mpp/mpp_pset.F90
shared/mpp/mpp_utilities.F90
shared/mpp/nsclock.c
shared/mpp/threadloc.c
shared/mpp/include/mpp_chksum.h
shared/mpp/include/mpp_chksum_int.h
shared/mpp/include/mpp_chksum_scalar.h
shared/mpp/include/mpp_comm.inc
shared/mpp/include/mpp_comm_mpi.inc
shared/mpp/include/mpp_comm_nocomm.inc
shared/mpp/include/mpp_comm_sma.inc
shared/mpp/include/mpp_data_mpi.inc
shared/mpp/include/mpp_data_nocomm.inc
shared/mpp/include/mpp_data_sma.inc
shared/mpp/include/mpp_do_get_boundary.h
shared/mpp/include/mpp_do_global_field.h
shared/mpp/include/mpp_do_redistribute.h
shared/mpp/include/mpp_do_update.h
shared/mpp/include/mpp_do_updateV.h
shared/mpp/include/mpp_do_updateV_ad.h
shared/mpp/include/mpp_do_update_ad.h
shared/mpp/include/mpp_domains_comm.inc
shared/mpp/include/mpp_domains_define.inc
shared/mpp/include/mpp_domains_misc.inc
shared/mpp/include/mpp_domains_reduce.inc
shared/mpp/include/mpp_domains_util.inc
shared/mpp/include/mpp_error_a_a.h
shared/mpp/include/mpp_error_a_s.h
shared/mpp/include/mpp_error_s_a.h
shared/mpp/include/mpp_error_s_s.h
shared/mpp/include/mpp_get_boundary.h
shared/mpp/include/mpp_global_field.h
shared/mpp/include/mpp_global_reduce.h
shared/mpp/include/mpp_global_sum.h
shared/mpp/include/mpp_global_sum_ad.h
shared/mpp/include/mpp_global_sum_tl.h
shared/mpp/include/mpp_io_connect.inc
shared/mpp/include/mpp_io_misc.inc
shared/mpp/include/mpp_io_read.inc
shared/mpp/include/mpp_io_util.inc
shared/mpp/include/mpp_io_write.inc
shared/mpp/include/mpp_read_2Ddecomp.h
shared/mpp/include/mpp_reduce_mpi.h
shared/mpp/include/mpp_reduce_nocomm.h
shared/mpp/include/mpp_reduce_sma.h
shared/mpp/include/mpp_sum.inc
shared/mpp/include/mpp_sum_mpi.h
shared/mpp/include/mpp_sum_nocomm.h
shared/mpp/include/mpp_sum_sma.h
shared/mpp/include/mpp_transmit.inc
shared/mpp/include/mpp_transmit_mpi.h
shared/mpp/include/mpp_transmit_nocomm.h
shared/mpp/include/mpp_transmit_sma.h
shared/mpp/include/mpp_update_domains2D.h
shared/mpp/include/mpp_update_domains2D_ad.h
shared/mpp/include/mpp_util.inc
shared/mpp/include/mpp_util_mpi.inc
shared/mpp/include/mpp_util_nocomm.inc
shared/mpp/include/mpp_util_sma.inc
shared/mpp/include/mpp_write.h
shared/mpp/include/mpp_write_2Ddecomp.h
shared/mpp/include/system_clock.h
shared/test/dump_field.F90
EOF_shared
$root/bin/list_paths $root/src/shared
mv path_names $pathnames_shared

set srcList = ( shared/tridiagonal shared/tracer_manager shared/topography shared/time_manager shared/time_interp shared/station_data shared/sat_vapor_pres shared/random_numbers shared/platform shared/oda_tools shared/diag_manager shared/data_override shared/constants shared/column_diagnostics shared/axis_utils shared/astronomy shared/amip_interp shared/fft shared/field_manager shared/horiz_interp shared/include shared/memutils shared/mosaic shared/coupler shared/test shared/version)

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/driver/coupled/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Surf_diff, Grid_box)

!----- write version and namelist to log file -----

call write_version_number()
call write_version_number(version, tagname)
logunit = stdlog()
if ( mpp_pe() == mpp_root_pe() ) write (logunit, nml=atmosphere_nml)

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/driver/coupled/bgrid_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ subroutine bgrid_physics_init (axes, Time, Hgrid, Vgrid, Dynam, &

!----- write version to logfile --------

call write_version_number()
call write_version_number(version, tagname)

!---------- get local grid box edges ---------

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/driver/shallow/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ subroutine atmosphere_init ( Time_init, Time, Time_step )

!----- write version and namelist to log file -----

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) write (stdlog(), nml=atmosphere_nml)

!---- compute physics/atmos time step in seconds ----
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/driver/solo/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ subroutine atmosphere_init ( Time_init, Time, Time_step )

!----- write version and namelist to log file -----

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) write (stdlog(), nml=atmosphere_nml)

!---- compute physics/atmos time step in seconds ----
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_advection.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ subroutine advection_init ( Hgrid )
logunit = stdlog()
! write version, namelist info to log file
if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=bgrid_advection_nml)
do_log = .false.
endif
Expand Down
4 changes: 2 additions & 2 deletions src/atmos_bgrid/model/bgrid_conserve_energy.F90
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ subroutine bgrid_conserve_energy_init ( Time, axes )
type(time_type), intent(in) :: Time
integer, intent(in) :: axes(3)

call write_version_number()
call write_version_number(version, tagname)

id_clock = mpp_clock_id ('BGRID: conserve_energy', &
flags=MPP_CLOCK_SYNC, grain=CLOCK_MODULE)
Expand Down Expand Up @@ -175,7 +175,7 @@ subroutine bgrid_conserve_energy_end

integer :: logunit
! rewrite module name and version info to log file
call write_version_number()
call write_version_number(version, tagname)
! write diagnostic to log file
logunit = stdlog()
if (mpp_pe() == mpp_root_pe()) write (logunit,*) &
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_core.F90
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ subroutine bgrid_core_init (Dynam, Hgrid, Vgrid, fis, res, dt, ntadj, ntadv, &

!-----------------------------------------------------------------------

call write_version_number()
call write_version_number(version, tagname)

logunit = stdlog()
write (logunit,10) dt, dt/real(Dynam%nt_adv), Dynam%dt_adj
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_core_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ subroutine bgrid_core_driver_init ( Time_init, Time, Time_step, &

! ----- write version, namelist and tracer info to log file -----

call write_version_number()
call write_version_number(version, tagname)
if (mpp_pe() == mpp_root_pe()) then
write (logunit, nml=bgrid_core_driver_nml)
write (logunit, '(a,i3)') 'Number of tracers =', ntrace
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_horiz_diff.F90
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ subroutine horiz_diff_init ( Hgrid )

logunit = stdlog()
if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=bgrid_horiz_diff_nml)
do_log = .false.
endif
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_sponge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ subroutine sponge_init (Hgrid )
endif
! write version and namelist to log
if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
logunit=stdlog()
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=bgrid_sponge_nml)
do_log = .false.
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/model/bgrid_vert_adjust.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ end subroutine vert_adjust

subroutine vert_adjust_init

call write_version_number()
call write_version_number(version, tagname)

id_clock = mpp_clock_id ('BGRID: vert_adjust', flags=MPP_CLOCK_SYNC, &
grain=CLOCK_MODULE)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_cold_start.F90
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ subroutine cold_start_resol ( nx, ny, nz )

!-------- write version and namelist to log file --------

call write_version_number()
call write_version_number(version, tagname)
logunit = stdlog()
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=bgrid_cold_start_nml)

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ subroutine bgrid_diagnostics_init ( Time, Hgrid, Vgrid, Var, &
missing_value=-1.e30 )

! write version (to log file)
call write_version_number()
call write_version_number(version, tagname)

! register diagnostics for all tracers
allocate (id_tracer(Var%ntrace))
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_horiz.F90
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ subroutine horiz_grid_init ( Hgrid, nlon, nlat, layout )

! write version info to logfile
if (do_vers) then
call write_version_number()
call write_version_number(version, tagname)
do_vers = .false.
endif

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_integrals.F90
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ subroutine bgrid_integrals_init (Time_init, Time)
#endif
endif

call write_version_number()
call write_version_number(version, tagname)
logunit = stdlog()
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=bgrid_integrals_nml)
do_init = .false.
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_masks.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ subroutine grid_masks_init (Hgrid, Vgrid, res, Masks)
real :: aeta(Vgrid%nlev)

if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
do_log = .false.
endif
logunit = stdlog()
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_polar_filter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ subroutine polar_filter_init ( Control, Hgrid, nlev, reflat, weight, sigma, verb
!-----------------------------------------------------------------------

if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
do_log = .false.
endif

Expand Down
4 changes: 2 additions & 2 deletions src/atmos_bgrid/tools/bgrid_prog_var.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ subroutine prog_var_init (Hgrid, nlev, ntrs, Vars)
!-----------------------------------------------------------------------
! write version info to logfile
if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
do_log = .false.
endif

Expand Down Expand Up @@ -363,7 +363,7 @@ subroutine open_prog_var_file ( ix, jx, kx, dir )

! write version info to logfile
if (do_log) then
call write_version_number()
call write_version_number(version, tagname)
do_log = .false.
endif

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_bgrid/tools/bgrid_vert.F90
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ subroutine vert_grid_init ( Vgrid, eta, peta, verbose )
Vgrid % gamma = gamma

!--- write version info to logfile ---
call write_version_number()
call write_version_number(version, tagname)

!--- optional output of coordinate values ----
logunit= stdlog()
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_coupled/atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ subroutine atmos_model_init (Atmos, Time_init, Time, Time_step)
!-----------------------------------------------------------------------
!---- print version number to logfile ----

call write_version_number()
call write_version_number(version, tagname)
! write the namelist to a log file
if (mpp_pe() == mpp_root_pe()) then
unit = stdlog( )
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_ebm/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ subroutine atmosphere_init(Time_init, Time_in, Time_step_in, Surf_diff, Grid_box
call close_file(unit)

!--- write out version information
call write_version_number()
call write_version_number(version, tagname)


!-----------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_ebm/ebm_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ subroutine ebm_diagnostics_init(Time, lon_max, lat_max, axis_id)
logical :: used

!--- write out version information -------------------------------------
call write_version_number()
call write_version_number(version, tagname)

call get_grid_boundaries(lonb,latb,global=.true.)
call get_deg_lon(lon)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_fv_dynamics/driver/coupled/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ subroutine atmosphere_init (Time_init, Time, Time_step, Surf_diff, Grid_box)

!----- write version and namelist to log file -----

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) then
log_unit = stdlog()
write (log_unit, nml=atmosphere_nml)
Expand Down
4 changes: 2 additions & 2 deletions src/atmos_fv_dynamics/driver/coupled/fv_physics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module fv_physics_mod

!-----------------------------------------------------------------------
character(len=128) :: version = '$Id: fv_physics.F90,v 20.0 2013/12/13 23:08:17 fms Exp $'
character(len=128) :: tag = '$Name: tikal $'
character(len=128) :: tagname = '$Name: tikal $'
!-----------------------------------------------------------------------

real zvir, rrg, ginv
Expand Down Expand Up @@ -120,7 +120,7 @@ subroutine fv_physics_init (axes, Time, window, Surf_diff)

!----- write version to logfile --------

call write_version_number()
call write_version_number(version, tagname)

!---------- reference profile -----------

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_fv_dynamics/driver/solo/atmosphere.F90
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ subroutine atmosphere_init ( Time_init, Time, Time_step )

!----- write version and namelist to log file -----

call write_version_number()
call write_version_number(version, tagname)

!---- compute physics/atmos time step in seconds ----

Expand Down
2 changes: 1 addition & 1 deletion src/atmos_fv_dynamics/model/fv_pack.F90
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ subroutine fv_init(ndt)

endif !}

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) then
log_unit = stdlog()
write (log_unit, nml=fv_core_nml)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_param/betts_miller/betts_miller.F90
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ subroutine betts_miller_init ()

!---------- output namelist --------------------------------------------

call write_version_number()
call write_version_number(version, tagname)
logunit = stdlog()
if ( mpp_pe() == mpp_root_pe() ) then
write (logunit,nml=betts_miller_nml)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_param/betts_miller/bm_massflux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ subroutine bm_massflux_init ()

!---------- output namelist --------------------------------------------

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) then
logunit = stdlog()
write (logunit,nml=bm_massflux_nml)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_param/betts_miller/bm_omp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ subroutine bm_omp_init ()

!---------- output namelist --------------------------------------------

call write_version_number()
call write_version_number(version, tagname)
if ( mpp_pe() == mpp_root_pe() ) then
logunit = stdlog()
write (logunit,nml=bm_omp_nml)
Expand Down
2 changes: 1 addition & 1 deletion src/atmos_param/cg_drag/cg_drag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ subroutine cg_drag_init (lonb, latb, pref, Time, axes)
!---------------------------------------------------------------------
! write version number and namelist to logfile.
!---------------------------------------------------------------------
call write_version_number()
call write_version_number(version, tagname)
logunit = stdlog()
if (mpp_pe() == mpp_root_pe()) write (logunit, nml=cg_drag_nml)

Expand Down
Loading

0 comments on commit 5f70c21

Please sign in to comment.