Skip to content

Commit

Permalink
Add Crocus snowpack/glacier model to WRF-Hydro (#607)
Browse files Browse the repository at this point in the history
* Add Crocus to Noah-MP
* Move lat lon in snowcro since they are not used
* Move max SWE limit to a parameter in MPTABLE.
* Fix energy NAs over large snowpacks due to very small numbers being rounded to 0, so number/number=NA instead of 1. Switched to an if statement.
* Add swe_limit into crocus specific calls
* Add outputs (flow from glacier snow or glacier ice)
* Add crocus outputs to retro config.
* Move a series of files that module_snowcro.F needs to the surfex directory for a cleaner build, and modify Makefile as necessary
* Move a series of files from Land_models/NoahMP/phys directory into a subdirectory and update the Makefile paths to those files and include the new surfex subdirectory
* Increase max SWE in glacier module to 5m to match standard snow model max value.
* Remove swe max limit.
* Add Aubreys changes for energy balance
* Add option to add visible albedo map
* Add possibility to read visible ice albedo from netcdf file
* Add Crocus namelist to end of namelist.hrldas
* Crocus: Set the ldasOutDict numLev to the act_lev input from the namelist file
* Crocus: crocus can be turned off and on with crocus_opt
* Crocus: code cleanup and formatting
* Crocus: if vis_icealb is not present, set it to NaN
* Crocus: removed dev comments and reformatted code
* Crocus: Trude fix of SNOW being updated, rather than SNEQVOXY
* Crocus: bug fix, certain values needed to be reset while iterating over array
* Crocus: Trude fix for when snowthickness becomes zero in the top layer
* Crocus: bugfix to albedo output. Code from Trude Eidhammer
* Bugfix: ALBSND and ALBSNI should be undefined when NOAHMP_SFLX isn't called. Fixes some output file differences

Co-authored-by: Trude Eidhammer <trude@ucar.edu>
Co-authored-by: Aubrey Dugger <adugger@ucar.edu>
Co-authored-by: Ryan Cabell <rcabell@ucar.edu>
  • Loading branch information
4 people authored Mar 21, 2022
1 parent 6f314bc commit c20829c
Show file tree
Hide file tree
Showing 24 changed files with 12,785 additions and 412 deletions.
6 changes: 3 additions & 3 deletions trunk/NDHMS/Land_models/NoahMP/IO_code/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Makefile
# Makefile
#
.SUFFIXES:
.SUFFIXES: .o .F
Expand All @@ -20,13 +20,13 @@ NoahMP : $(OBJS_NoahMP) $(OBJS)
module_NoahMP_hrldas_driver.o: module_NoahMP_hrldas_driver.F ../../../HYDRO_drv/module_HYDRO_drv.o ../../../Data_Rec/module_namelist.o ../../../Data_Rec/module_RT_data.o
@echo ""
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(MODFLAG) -I. \
-I../phys -I../Utility_routines -I../../../mod $(NETCDFMOD) $(*).F
-I../phys -I../phys/surfex -I../Utility_routines -I../../../mod $(NETCDFMOD) $(*).F
@echo ""

main_hrldas_driver.o: ../../../OrchestratorLayer/orchestrator.o main_hrldas_driver.F
@echo ""
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) -I ../MPP -I. \
-I../phys -I../Utility_routines -I../../../mod -I../../../MPP -I../data_structures $(NETCDFMOD) $(*).F
-I../phys -I../phys/surfex -I../Utility_routines -I../../../mod -I../../../MPP -I../data_structures $(NETCDFMOD) $(*).F
# $(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) -I ../MPP -I. \
# -I../phys -I../Utility_routines $(NETCDFMOD) $(*).f90
@echo ""
Expand Down
340 changes: 300 additions & 40 deletions trunk/NDHMS/Land_models/NoahMP/IO_code/module_NoahMP_hrldas_driver.F

Large diffs are not rendered by default.

144 changes: 116 additions & 28 deletions trunk/NDHMS/Land_models/NoahMP/IO_code/module_hrldas_netcdf_io.F

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions trunk/NDHMS/Land_models/NoahMP/phys/Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# Makefile
# Makefile
#
.SUFFIXES:
.SUFFIXES: .o .F

include ../user_build_options

OBJS = \
module_sf_noahmpdrv.o \
module_sf_noahmplsm.o \
module_sf_noahmp_glacier.o \
module_sf_noahmp_groundwater.o

SRCS := $(wildcard *.F)
OBJS := $(SRCS:%.F=%.o)
SUR_SRCS := $(wildcard surfex/*.F)
SUR_OBJS := $(SUR_SRCS:%.F=%.o)
CPPHRLDAS = -D_HRLDAS_OFFLINE_

all: $(OBJS)
all: $(OBJS)

.F.o:
%.o:%.F
@echo ""
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c -I../Utility_routines $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).F
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $(@) -c -I../Utility_routines -Isurfex $(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $(*).F
@echo ""

surfex/%.o:
$(MAKE) --directory=surfex/

#
# Dependencies:
#
module_sf_noahmpdrv.o: module_sf_noahmplsm.o module_sf_noahmp_glacier.o module_sf_noahmp_groundwater.o
module_sf_noahmpdrv.o: module_sf_noahmplsm.o module_sf_noahmp_glacier.o module_sf_noahmp_groundwater.o module_snowcro.o
module_sf_noahmp_groundwater.o: module_sf_noahmplsm.o
module_snowcro.o: $(SUR_OBJS)

#
# This command cleans up object (etc) files:
#

clean:
$(MAKE) clean --directory=surfex
$(RM) *.o *.mod *.stb *~

238 changes: 121 additions & 117 deletions trunk/NDHMS/Land_models/NoahMP/phys/module_sf_noahmp_glacier.F

Large diffs are not rendered by default.

814 changes: 654 additions & 160 deletions trunk/NDHMS/Land_models/NoahMP/phys/module_sf_noahmpdrv.F

Large diffs are not rendered by default.

5,661 changes: 5,661 additions & 0 deletions trunk/NDHMS/Land_models/NoahMP/phys/module_snowcro.F

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions trunk/NDHMS/Land_models/NoahMP/phys/surfex/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Makefile
#

include ../../user_build_options
SRCS := $(wildcard *.F)
OBJS := $(SRCS:%.F=%.o)
CPPHRLDAS = -D_HRLDAS_OFFLINE_

all: $(OBJS)

%.o:%.F
@echo ""
$(COMPILERF90) $(CPPINVOKE) $(CPPFLAGS) $(CPPHRLDAS) -o $@ -c -I../Utility_routines \
$(F90FLAGS) $(LDFLAGS) $(FREESOURCE) $<
@echo ""

#
# Dependencies:
#
mode_snow3l.o: modd_snow_par.o modd_csts.o modd_snow_metamo.o
mode_thermos.o: modd_csts.o modd_snow_par.o
mode_surf_coefs.o: modd_surf_atm.o mode_thermos.o
ini_csts.o: modd_csts.o


#
# This command cleans up object (etc) files:
#
clean:
$(RM) *.o *.mod *.stb *~
Loading

0 comments on commit c20829c

Please sign in to comment.