Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
4093dd0
Merge pull request #20 from NCAR/develop
cenlinhe Nov 30, 2021
d7c09de
Merge pull request #21 from NCAR/develop
cenlinhe Dec 1, 2021
b437865
update submodule link to NoahMP master branch
cenlinhe Dec 1, 2021
6de0def
Update README.md
cenlinhe Dec 1, 2021
be9cd93
sync with latest NoahMP repo
cenlinhe Dec 1, 2021
b4801a0
update with NoahMP new driver directory path
cenlinhe Dec 7, 2021
c6f229c
sync with updated NoahMP repo
cenlinhe Jan 10, 2022
304419d
update hrldas driver to sync up with NoahMP additonal water budget an…
cenlinhe Jan 14, 2022
e6d328f
sync with updated NoahMP master branch
cenlinhe Mar 21, 2022
53268c9
bring local QMELT to output
cenlinhe Mar 23, 2022
c28c0c1
sync with NoahMP for glacier cosz<0 bug fix
cenlinhe Mar 31, 2022
6c43838
bug fix for rainrate output variable and sync with NoahMP
cenlinhe Apr 5, 2022
3c52a9b
sync with noahmp update for bug fix
cenlinhe Sep 8, 2022
84821f1
bug fix for output vars unit with develop#8250597
cenlinhe Sep 8, 2022
b269604
bug fix for gfortran compatibility issue
cenlinhe Sep 13, 2022
f3acee5
sync with noahmp for bug fix of LCZ and INFIL max
cenlinhe Oct 3, 2022
9071a2c
Sync with develop branch for Pre-processing ERA5-Land data in create_…
cenlinhe Oct 5, 2022
d6cbe61
Sync with NoahMP bug fix for crop and LCZ
cenlinhe Oct 14, 2022
3ae060a
sync with NoahMP for LCZ number update
cenlinhe Nov 20, 2022
a7a781b
Sync with NoahMP for bug fix in Q2 in Jarvis
cenlinhe Dec 1, 2022
5f89522
bug fix for itimestep update
cenlinhe Dec 10, 2022
0c73a38
bug fix for urban dimension parameter in hrldas driver
cenlinhe Dec 20, 2022
7b92806
sync with Noah-MP canopy heat capacity parameter update
cenlinhe Dec 23, 2022
51c53f1
correct Xinanjiang name in comment
cenlinhe Dec 23, 2022
05391c5
bug fix for urban variable dimension in restart file
cenlinhe Jan 8, 2023
14f327f
update urban code to the latest WRF-urban v4.4.3 version
cenlinhe Jan 9, 2023
282fa45
bug fix for gfl in bep_bem
cenlinhe Jan 29, 2023
01cc326
update user_build_options files
cenlinhe Feb 18, 2023
8ff3ca6
+1 to (i,j) loop in groundwater_init to include the outermost grids
cenlinhe Feb 24, 2023
a631faa
bug fix bug fix for SLUCM initialization & CHS calc
cenlinhe Mar 9, 2023
a6d52c6
release of version 5.0
cenlinhe Mar 10, 2023
2b06d47
release of version 5.0
cenlinhe Mar 10, 2023
b4adac0
Merge pull request #34 from NCAR/develop
cenlinhe Mar 10, 2023
336f990
Merge pull request #35 from NCAR/develop
cenlinhe Mar 10, 2023
d9ddd3e
Merge pull request #36 from NCAR/develop
cenlinhe Mar 10, 2023
ff83f8d
Merge pull request #38 from NCAR/develop
cenlinhe Mar 14, 2023
5b199a6
Merge pull request #39 from NCAR/develop
cenlinhe Mar 15, 2023
edc050e
Merge pull request #41 from NCAR/develop
cenlinhe Mar 16, 2023
d667062
Merge pull request #44 from NCAR/develop
cenlinhe Mar 19, 2023
dee7d4f
Merge pull request #46 from NCAR/develop
cenlinhe Mar 20, 2023
23496f1
Merge pull request #48 from NCAR/develop
cenlinhe Mar 29, 2023
dca5c85
Merge pull request #50 from NCAR/develop
cenlinhe Mar 30, 2023
2891670
Merge pull request #52 from NCAR/develop
cenlinhe Apr 13, 2023
788aef7
Merge pull request #54 from NCAR/develop
cenlinhe Apr 17, 2023
e1a02b6
Merge pull request #57 from NCAR/develop
cenlinhe May 6, 2023
8e08d41
Merge pull request #58 from NCAR/develop
cenlinhe May 6, 2023
7229073
update example single point forcing file with UTC
cenlinhe May 18, 2023
bfd30b7
Merge pull request #61 from NCAR/develop
cenlinhe May 18, 2023
b176577
Merge pull request #63 from NCAR/develop
cenlinhe May 18, 2023
3ba535c
update tutorial docs
cenlinhe May 25, 2023
7008cc0
remove duplicated file
cenlinhe May 25, 2023
ab9f1c3
Merge pull request #66 from NCAR/develop
cenlinhe May 25, 2023
7ba10b2
Add an instruction to build dependent libraries
CharlesZheZhang May 26, 2023
20be331
Merge pull request #70 from NCAR/develop
cenlinhe May 28, 2023
8732faf
Merge pull request #76 from NCAR/develop
cenlinhe Jun 10, 2023
1c695d6
Merge pull request #80 from NCAR/develop
cenlinhe Jun 16, 2023
9df967d
Update README.md
cenlinhe Sep 8, 2023
a340878
Merge pull request #104 from NCAR/develop
cenlinhe Sep 19, 2023
3a18149
Merge pull request #107 from NCAR/develop
cenlinhe Sep 21, 2023
f550db9
Merge pull request #109 from NCAR/develop
cenlinhe Sep 22, 2023
cb009ee
Merge pull request #116 from NCAR/develop
cenlinhe Oct 18, 2023
ad46713
Merge pull request #119 from NCAR/develop
cenlinhe Oct 22, 2023
4262727
Merge pull request #122 from NCAR/develop
cenlinhe Oct 26, 2023
fa2f329
Merge pull request #129 from NCAR/develop
cenlinhe Nov 14, 2023
ef9b687
Merge pull request #134 from NCAR/develop
cenlinhe Nov 30, 2023
0de57f9
Merge pull request #146 from NCAR/develop
cenlinhe Jan 5, 2024
170959d
Merge pull request #149 from NCAR/develop
cenlinhe Jan 6, 2024
c4b5a54
Merge pull request #151 from NCAR/develop
cenlinhe Jan 8, 2024
48792fd
Merge pull request #159 from NCAR/develop
cenlinhe Feb 26, 2024
d4b583d
Merge pull request #165 from NCAR/develop
cenlinhe Mar 8, 2024
b9ed36c
Update .gitmodules
prasanthvkrishna Mar 9, 2024
087f1fd
Merge pull request #168 from NCAR/develop
cenlinhe Mar 13, 2024
1ea9a1f
Merge branch 'NCAR:master' into master
prasanthvkrishna Mar 13, 2024
e6853ef
Merge pull request #206 from NCAR/develop
cenlinhe Aug 15, 2024
7d183b9
Merge pull request #216 from NCAR/develop
cenlinhe Oct 11, 2024
45ec7d1
Merge pull request #229 from NCAR/develop
cenlinhe Nov 14, 2024
85fcd5b
Merge pull request #241 from NCAR/develop
cenlinhe Jan 30, 2025
a4f4a2c
Merge pull request #243 from NCAR/develop
cenlinhe Feb 2, 2025
3e1c2ba
Merge pull request #254 from NCAR/develop
cenlinhe Apr 18, 2025
5f37a9e
Merge pull request #262 from NCAR/develop
cenlinhe May 23, 2025
6adaba7
update release note and readme for v5.1.0 release
cenlinhe May 23, 2025
daca8e8
Merge pull request #266 from NCAR/develop
cenlinhe Jun 1, 2025
2c79e83
Merge branch 'NCAR:master' into master
prasanthvkrishna Jun 11, 2025
256bdb3
Merge pull request #271 from NCAR/develop
cenlinhe Jun 26, 2025
adfd85a
Merge branch 'NCAR:master' into master
prasanthvkrishna Jul 10, 2025
603f68f
initial commit
prasanthvkrishna Jul 16, 2025
40597a7
io_code_edited_v1
prasanthvkrishna Sep 29, 2025
4638667
io and makefile
prasanthvkrishna Oct 19, 2025
1bdeba4
io and makefile
prasanthvkrishna Oct 19, 2025
ea36770
Update .gitmodules
prasanthvkrishna Oct 19, 2025
fc96786
compiled
prasanthvkrishna Oct 26, 2025
44bc7c9
mosaic_geodata
prasanthvkrishna Dec 18, 2025
4f3657b
bugfix mosaic
prasanthvkrishna Dec 28, 2025
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "noahmp"]
path = noahmp
url = https://github.com/NCAR/noahmp
branch = develop
url = https://github.com/prasanthvkrishna/noahmp
branch = subgrid
40 changes: 36 additions & 4 deletions hrldas/IO_code/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# Makefile
#
.SUFFIXES:
.SUFFIXES: .o .F
.SUFFIXES: .o .F .F90

include ../user_build_options

OBJS_NoahMP = module_NoahMP_hrldas_driver.o

OBJS = \
main_hrldas_driver.o \
module_hrldas_netcdf_io.o
module_hrldas_netcdf_io.o\
MosaicAverageMod.o\
WriteNoahmpMosaicGridAverageOutputMod.o\
WriteNoahmpMosaicSubgridOutputMod.o\
WriteNoahmpMosaicRestartMod.o\
ReadNoahmpMosaicRestartMod.o

CPPHRLDAS = -D_HRLDAS_OFFLINE_ $(MOD_OPT)

Expand Down Expand Up @@ -47,14 +52,41 @@ module_hrldas_netcdf_io.o: module_hrldas_netcdf_io.F
$(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) $(*).f90
@echo ""


.F90.o:
@echo ""
$(RM) $(*).f90
$(CPP) $(CPPFLAGS) $(CPPHRLDAS) $(*).F90 > $(*).f90
$(COMPILERF90) -o $(@) -c $(F90FLAGS) $(FREESOURCE) -I. -I../../noahmp/utility -I../../noahmp/drivers/hrldas $(*).f90
@echo ""

#
# Dependencies:
#

main_hrldas_driver.o: $(OBJS_NoahMP)
$(OBJS_NoahMP): module_hrldas_netcdf_io.o
$(OBJS_NoahMP): module_hrldas_netcdf_io.o\
MosaicAverageMod.o\
WriteNoahmpMosaicGridAverageOutputMod.o\
WriteNoahmpMosaicSubgridOutputMod.o\
WriteNoahmpMosaicRestartMod.o\
ReadNoahmpMosaicRestartMod.o\
../../noahmp/drivers/hrldas/NoahmpMosaicSortTileCatMod.o

MosaicAverageMod.o: ../../noahmp/utility/Machine.o\
../../noahmp/drivers/hrldas/NoahmpIOVarType.o
WriteNoahmpMosaicGridAverageOutputMod.o: ../../noahmp/utility/Machine.o\
../../noahmp/drivers/hrldas/NoahmpIOVarType.o\
module_hrldas_netcdf_io.o\
MosaicAverageMod.o
WriteNoahmpMosaicSubgridOutputMod.o: ../../noahmp/utility/Machine.o\
../../noahmp/drivers/hrldas/NoahmpIOVarType.o\
module_hrldas_netcdf_io.o
WriteNoahmpMosaicRestartMod.o: ../../noahmp/utility/Machine.o\
../../noahmp/drivers/hrldas/NoahmpIOVarType.o\
module_hrldas_netcdf_io.o
ReadNoahmpMosaicRestartMod.o: ../../noahmp/utility/Machine.o\
../../noahmp/drivers/hrldas/NoahmpIOVarType.o\
module_hrldas_netcdf_io.o

# This command cleans up object files, etc.
clean:
Expand Down
116 changes: 116 additions & 0 deletions hrldas/IO_code/MosaicAverageMod.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
module MosaicAverageMod

!!! This module is part of NoahMP Mosaic/Subgrid Tiling Scheme
!!! Purpose: To calculate grid average value from all subgrid fractions

! ------------------------ Code history -----------------------------------
! Original code : Prasanth Valayamkunnath (IISER Thiruvananthapuram)
! Date : September 12, 2025
! -------------------------------------------------------------------------

use Machine
use NoahmpIOVarType

implicit none

! Interface block for MosaicAverage
interface MosaicAverage
module procedure MosaicAverage_2d
module procedure MosaicAverage_3d
module procedure MosaicAverage_2d_int
end interface MosaicAverage

contains

!=== Calculate averages along subgrid fractions ===!

function MosaicAverage_2d(InVariable,NMPIO) result(OutAverage)
real(kind=kind_noahmp), dimension(:,:,:), intent(in) :: InVariable
real(kind=kind_noahmp), allocatable, dimension(:,:) :: OutAverage
type(NoahmpIO_type), intent(in) :: NMPIO
integer :: ixpar, jxpar, nxpar

! Get dimensions
ixpar = size(InVariable, 1)
jxpar = size(InVariable, 2)
nxpar = size(InVariable, 3)

! Check dimensions of SubGrdFracMosaic
if (size(NMPIO%SubGrdFracMosaic, 1) /= ixpar .or. &
size(NMPIO%SubGrdFracMosaic, 2) /= jxpar .or. &
size(NMPIO%SubGrdFracMosaic, 3) /= nxpar) then
stop "Error: Dimension mismatch in NoahmpIO%SubGrdFracMosaic for MosaicAverage_2d"
end if

! Allocate output array
allocate(OutAverage(ixpar, jxpar))

! Calculate weighted average
OutAverage = sum(InVariable * NMPIO%SubGrdFracMosaic, dim=3)

end function MosaicAverage_2d

function MosaicAverage_3d(InVariable,NMPIO) result(OutAverage)
real(kind=kind_noahmp), dimension(:,:,:,:), intent(in) :: InVariable
real(kind=kind_noahmp), allocatable, dimension(:,:,:) :: OutAverage
real(kind=kind_noahmp), allocatable, dimension(:,:,:,:) :: SubGrdFrac
type(NoahmpIO_type), intent(in) :: NMPIO
integer :: ixpar, jxpar, kxpar, nxpar, k

! Get dimensions
ixpar = size(InVariable, 1)
kxpar = size(InVariable, 2)
jxpar = size(InVariable, 3)
nxpar = size(InVariable, 4)

! Check dimensions of SubGrdFracMosaic
if (size(NMPIO%SubGrdFracMosaic, 1) /= ixpar .or. &
size(NMPIO%SubGrdFracMosaic, 2) /= jxpar .or. &
size(NMPIO%SubGrdFracMosaic, 3) /= nxpar) then
stop "Error: Dimension mismatch in NoahmpIO%SubGrdFracMosaic for MosaicAverage_3d"
end if

! Allocate arrays
allocate(OutAverage(ixpar, kxpar, jxpar))
allocate(SubGrdFrac(ixpar, kxpar, jxpar, nxpar))

! Populate SubGrdFrac
do k = 1, kxpar
SubGrdFrac(:, k, :, :) = NMPIO%SubGrdFracMosaic
end do

! Calculate weighted average
OutAverage = sum(InVariable * SubGrdFrac, dim=4)

! Deallocate temporary array
deallocate(SubGrdFrac)

end function MosaicAverage_3d

function MosaicAverage_2d_int (InVariable, NMPIO) result(OutAverage)
integer, dimension(:,:,:), intent(in) :: InVariable
integer, allocatable, dimension(:,:) :: OutAverage
type(NoahmpIO_type), intent(in) :: NMPIO
integer :: ixpar, jxpar, nxpar

! Get dimensions
ixpar = size(InVariable, 1)
jxpar = size(InVariable, 2)
nxpar = size(InVariable, 3)

! Check dimensions of SubGrdFracMosaic
if (size(NMPIO%SubGrdFracMosaic, 1) /= ixpar .or. &
size(NMPIO%SubGrdFracMosaic, 2) /= jxpar .or. &
size(NMPIO%SubGrdFracMosaic, 3) /= nxpar) then
stop "Error: Dimension mismatch in NoahmpIO%SubGrdFracMosaic for MosaicAverage_2d"
end if

! Allocate output array
allocate(OutAverage(ixpar, jxpar))

! Calculate weighted average
OutAverage = nint(sum(InVariable * NMPIO%SubGrdFracMosaic, dim=3))

end function MosaicAverage_2d_int

end module MosaicAverageMod
Loading