Skip to content

Commit

Permalink
Add shared physics gwdo (#1989)
Browse files Browse the repository at this point in the history
TYPE: enhancement, new feature

KEYWORDS: shared physics, gwdo scheme

SOURCE: internal

DESCRIPTION OF CHANGES:
This PR makes use of the GWDO code (gwd_opt=1) from the future MMM-physics repository, which are CCPP-compliant. 

The CCPP-compliant GWDO code will be residing in phys/physics_mmm/ directory. Currently it is a copy of the code from the future MMM-physics repo. The file, module_bl_gwdo.F, has been changed to be a driver to call the actual physics routine in physics_mmm/.

LIST OF MODIFIED FILES:
M arch/postamble
M arch/preamble
M clean
M main/depend.common
M phys/Makefile
M phys/module_bl_gwdo.F
M phys/module_pbl_driver.F
A phys/physics_mmm/bl_gwdo.F90
M wrftladj/module_pbl_driver_ad.F

TESTS CONDUCTED:
- Option run before and after the change produced bit-for-bit results when compiled with -d option.
- The Jenkins tests are all passing.

RELEASE NOTE: Add gwdo (gwd_opt=1) code from the future shared MMM-physics repository.
  • Loading branch information
weiwangncar committed Feb 1, 2024
1 parent b006288 commit f8530bb
Show file tree
Hide file tree
Showing 9 changed files with 897 additions and 694 deletions.
14 changes: 14 additions & 0 deletions arch/postamble
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ wrfio_esmf :
fi
$(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90

.F90.o:
$(RM) $@
sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F90 > $*.G
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $(OMPCPP) $*.G > $*.bb
$(SED_FTN) $*.bb | $(CPP) $(TRADFLAG) > $*.f90
$(RM) $*.G $*.bb
$(FC) -o $@ -c $(FCFLAGS) $(OMP) $(MODULE_DIRS) $(PROMOTION) $(FCSUFFIX) $*.f90

.F.f90:
$(RM) $@
Expand All @@ -211,6 +218,13 @@ wrfio_esmf :
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.H > $@
$(RM) $*.G $*.H

.F90.f90:
$(RM) $@
sed -e "s/^\!.*'.*//" -e "s/^ *\!.*'.*//" $*.F90 > $*.G
$(SED_FTN) $*.G > $*.H
$(CPP) -I$(WRF_SRC_ROOT_DIR)/inc $(CPPFLAGS) $*.H > $@
$(RM) $*.G $*.H

.f90.o:
$(RM) $@
$(FC) -o $@ -c $(FCFLAGS) $(PROMOTION) $(FCSUFFIX) $*.f90
Expand Down
2 changes: 1 addition & 1 deletion arch/preamble
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SHELL = /bin/sh
DEVTOP = `pwd`
LIBINCLUDE = .
.SUFFIXES: .F .i .o .f90 .c
.SUFFIXES: .F .i .o .f90 .c .F90

#### Get core settings from environment (set in compile script)
#### Note to add a core, this has to be added to.
Expand Down
4 changes: 2 additions & 2 deletions clean
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
set nonomatch


foreach dir ( frame chem share dyn_em phys cmaq main tools wrftladj )
foreach dir ( frame chem share dyn_em phys phys/physics_mmm cmaq main tools wrftladj )
if ( -d $dir ) then
if ( $dir == cmaq ) then
( cd $dir ; echo $dir ; /bin/rm -f *.o *.mod ) >& /dev/null
else
( cd $dir ; echo $dir ; /bin/rm -f core wrf *.f90 *.exe *.kmo *.mod *.o *.obj *.inc *.F90 *.a \
( cd $dir ; echo $dir ; /bin/rm -f core wrf *.f90 *.exe *.kmo *.mod *.o *.obj *.inc *.a \
db_* Warnings module_state_description.F module_dm.F gmeta \
wrfdata whatiread rsl.* show_domain* ) >& /dev/null
endif
Expand Down
11 changes: 10 additions & 1 deletion main/depend.common
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ module_bl_qnsepbl.o: \


module_progtm.o: \
module_gfs_machine.o
module_gfs_machine.o


module_bl_gfs.o: \
Expand All @@ -321,6 +321,10 @@ module_bl_mynn_wrapper.o: \
module_bl_mynn_common.o


module_bl_gwdo.o: \
physics_mmm/bl_gwdo.o


module_cam_upper_bc.o: \
module_cam_shr_kind_mod.o \
module_cam_support.o
Expand Down Expand Up @@ -1478,6 +1482,11 @@ module_mp_gsfcgce_4ice_nuwrf.o: \
module_checkerror.o \
module_mp_radar.o \


physics_mmm/bl_gwdo.o : \
ccpp_kind_types.o


# End of DEPENDENCIES for phys


Expand Down
10 changes: 7 additions & 3 deletions phys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,23 @@ DIAGNOSTIC_MODULES_EM = \
module_diag_trad_fields.o \
module_diag_solar.o

PHYSMMM_MODULES = \
./physics_mmm/bl_gwdo.o

OBJS =

LIBTARGET = physics
TARGETDIR = ./

$(LIBTARGET) :
$(MAKE) $(J) non_nmm ; \
$(MAKE) $(J) non_nmm shared_phys ; \
$(AR) $(ARFLAGS) ../main/$(LIBWRFLIB) $(MODULES) $(OBJS) \
$(FIRE_MODULES) $(DIAGNOSTIC_MODULES_EM)
$(FIRE_MODULES) $(DIAGNOSTIC_MODULES_EM) $(PHYSMMM_MODULES)

include ../configure.wrf

non_nmm : $(MODULES) $(FIRE_MODULES) $(WIND_MODULES) $(OBJS) $(DIAGNOSTIC_MODULES_EM)
non_nmm : $(MODULES) $(FIRE_MODULES) $(OBJS) $(DIAGNOSTIC_MODULES_EM)
shared_phys : $(PHYSMMM_MODULES)

submodules :
@if [ \( ! -f module_sf_noahmpdrv.F \) -o \( ! -f module_sf_noahmp_glacier.F \) -o \
Expand Down
Loading

0 comments on commit f8530bb

Please sign in to comment.