Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoahMP as a submodule in WRF #1653

Merged
merged 6 commits into from
Jan 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "phys/noahmp"]
path = phys/noahmp
url = https://github.com/NCAR/noahmp
24 changes: 20 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ framework_only : configcheck

wrf : framework_only
$(MAKE) MODULE_DIRS="$(ALL_MODULES)" physics
if [ \( ! -f run/MPTABLE.TBL \) -o \
\( ! -f phys/module_sf_noahmpdrv.F \) -o \
\( ! -f phys/module_sf_noahmp_glacier.F \) -o \
\( ! -f phys/module_sf_noahmp_groundwater.F \) -o \
\( ! -f phys/module_sf_noahmplsm.F \) ] ; then \
echo " " ; \
echo "------------------------------------------------------------------------------" ; \
echo "Error Error Error NoahMP submodule files not populating WRF directories" ; \
echo "------------------------------------------------------------------------------" ; \
echo " " ; \
exit 31 ; \
else \
echo "------------------------------------------------------------------------------" ; \
echo "NoahMP submodule files populating WRF directories" ; \
echo "------------------------------------------------------------------------------" ; \
fi
if [ $(WRF_CHEM) -eq 1 ] ; then $(MAKE) MODULE_DIRS="$(ALL_MODULES)" chemics ; fi
if [ $(WRF_EM_CORE) -eq 1 ] ; then $(MAKE) MODULE_DIRS="$(ALL_MODULES)" em_core ; fi
if [ $(WRF_HYDRO) -eq 1 ] ; then $(MAKE) MODULE_DIRS="$(ALL_MODULES)" wrf_hydro ; fi
Expand Down Expand Up @@ -1009,20 +1025,20 @@ chemics :
physics :
@ echo '--------------------------------------'
if [ $(WRF_CHEM) -eq 0 ] ; then \
( cd phys ; $(MAKE) CF2=" " ) ; \
( cd phys ; $(MAKE) submodules ; $(MAKE) CF2=" " ) ; \
if [ $(WRF_CMAQ) -eq 1 ] ; then \
@ echo '----------- make cmaq ----------------' ; \
( rm -f main/libcmaqlib.a; cd cmaq ; $(MAKE) -f Makefile.twoway ) ; \
fi \
else \
( cd phys ; $(MAKE) CF2="$(CHEM_FILES2)" ) ; \
( cd phys ; $(MAKE) submodules ; $(MAKE) CF2="$(CHEM_FILES2)" ) ; \
fi

physics_plus :
if [ $(WRF_PLUS_CORE) -eq 0 ] ; then \
( cd phys ; $(MAKE) PHYS_PLUS=" " PHYS_MP=" " PHYS_BL=" " PHYS_CU=" " ) ; \
( cd phys ; $(MAKE) submodules ; $(MAKE) PHYS_PLUS=" " PHYS_MP=" " PHYS_BL=" " PHYS_CU=" " ) ; \
else \
( cd phys ; $(MAKE) PHYS_PLUS="$(MODS4)" PHYS_MP="$(MODMP)" PHYS_BL="$(MODBL)" PHYS_CU="$(MODCU)" ) ; \
( cd phys ; $(MAKE) submodules ; $(MAKE) PHYS_PLUS="$(MODS4)" PHYS_MP="$(MODMP)" PHYS_BL="$(MODBL)" PHYS_CU="$(MODCU)" ) ; \
fi

wrftlmadj :
Expand Down
3 changes: 3 additions & 0 deletions clean
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ if ( "$arg" == '-a' || "$arg" == '-aa' ) then
/bin/rm -f configure.wrf.backup
/bin/rm -f Registry/Registry.backup
/bin/rm -f run/namelist.input.backup.*
/bin/rm -f phys/module_sf_noahmpdrv.F phys/module_sf_noahmp_glacier.F \
phys/module_sf_noahmp_groundwater.F phys/module_sf_noahmplsm.F \
run/MPTABLE.TBL
endif
endif

Expand Down
14 changes: 14 additions & 0 deletions phys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ include ../configure.wrf

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

submodules :
@if [ \( ! -f module_sf_noahmpdrv.F \) -o \( ! -f module_sf_noahmp_glacier.F \) -o \
\( ! -f module_sf_noahmp_groundwater.F \) -o \( ! -f module_sf_noahmplsm.F \) ] ; then \
echo Pulling in NoahMP submodule ; \
( cd .. ; git submodule update --init --recursive ) ; \
ln -sf noahmp/drivers/wrf/module_sf_noahmpdrv.F . ; \
ln -sf noahmp/src/module_sf_noahmp_glacier.F . ; \
ln -sf noahmp/src/module_sf_noahmp_groundwater.F . ; \
ln -sf noahmp/src/module_sf_noahmplsm.F . ; \
( cd ../run ; ln -sf ../phys/noahmp/parameters/MPTABLE.TBL . ) ; \
else \
echo No action required for NoahMP submodule ; \
fi

clean:
@ echo 'use the clean script'

Expand Down
3,075 changes: 0 additions & 3,075 deletions phys/module_sf_noahmp_glacier.F

This file was deleted.

Loading