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

add landice gridcomp #18

Draft
wants to merge 30 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
70df564
initial check in (it can be built)
weiyuan-jiang Feb 9, 2024
6566c79
Merge branch 'develop' into feature/wjiang/add_landice
gmao-rreichle Feb 16, 2024
7bd6302
fixed locstream and timer for LANDICE
weiyuan-jiang Feb 19, 2024
b5be8c0
Merge branch 'feature/wjiang/add_landice' of github.com:GEOS-ESM/GEOS…
weiyuan-jiang Feb 19, 2024
157004f
add landice grid comp
weiyuan-jiang Apr 9, 2024
a145779
add postprocess for landice
weiyuan-jiang Apr 9, 2024
a09206b
Merge branch 'feature/wjiang/add_landice_1' into feature/wjiang/add_l…
weiyuan-jiang Apr 10, 2024
199ddc1
remove unnecessary arguments
weiyuan-jiang Apr 12, 2024
54304cd
Merge branch 'develop' into feature/wjiang/add_landice
weiyuan-jiang Apr 12, 2024
0c5bf7c
distribute forces
weiyuan-jiang Apr 25, 2024
430a4d6
use partial tiel_coord in metforce
weiyuan-jiang Apr 25, 2024
2184d72
change local index to global index
weiyuan-jiang Apr 26, 2024
9c0b76f
remove name '_internal" from landassim_obs...
weiyuan-jiang Apr 26, 2024
dddd9f1
rename model to landmodel
weiyuan-jiang Apr 29, 2024
1ea1c10
Merge branch 'develop' into feature/wjiang/add_landice
gmao-rreichle May 17, 2024
8bfa673
Merge branch 'develop' into feature/wjiang/add_landice
gmao-rreichle Jun 13, 2024
d553e78
first check in for mapping files
weiyuan-jiang Jun 17, 2024
e158958
change f2g contents for other tile types
weiyuan-jiang Jul 17, 2024
abfe6f0
works for no zoom in
weiyuan-jiang Jul 18, 2024
0242100
good for zoomin without other tile types
weiyuan-jiang Jul 18, 2024
72c8daf
create zoomin landice restart and more cleanup
weiyuan-jiang Aug 14, 2024
13f7bac
working...
weiyuan-jiang Aug 16, 2024
d4936a6
consolidate creating the restarts
weiyuan-jiang Aug 19, 2024
18102e8
Merge branch 'develop' into feature/wjiang/add_landice
biljanaorescanin Aug 19, 2024
2c5102e
bug fix
weiyuan-jiang Aug 19, 2024
10709a4
more bug fix
weiyuan-jiang Aug 19, 2024
6f343db
bug fixed (i_indg) and add LAND_TYPES item
weiyuan-jiang Aug 29, 2024
a5b2d2a
landice model simulation only
weiyuan-jiang Oct 16, 2024
7c16f21
fix bug on setup
weiyuan-jiang Oct 16, 2024
7cf84b7
first run and fix bug
weiyuan-jiang Oct 16, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Added landice grid comp

### Changed

- More optimal distribution of tiles on processors for cubed-sphere tile space.
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ esma_add_library(${this}
SRCS GEOS_LdasGridComp.F90
SUBCOMPONENTS ${alldirs}
SUBDIRS LDAS_Shared
DEPENDENCIES GEOSland_GridComp makebcs MAPL
DEPENDENCIES GEOSland_GridComp GEOSlandice_GridComp makebcs MAPL
INCLUDES ${INC_ESMF})

esma_add_subdirectory(GEOSldas_App)
546 changes: 315 additions & 231 deletions GEOS_LdasGridComp.F90

Large diffs are not rendered by default.

332 changes: 191 additions & 141 deletions GEOSldas_App/ldas_setup

Large diffs are not rendered by default.

42 changes: 23 additions & 19 deletions GEOSldas_App/lenkf_j_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

setenv HOMDIR $EXPDIR/run/
setenv SCRDIR $EXPDIR/scratch
setenv MODEL {MY_MODEL}
setenv LANDMODEL {MY_LANDMODEL}
setenv MYNAME `finger $USER | cut -d: -f3 | head -1`
setenv POSTPROC_HIST {MY_POSTPROC_HIST}

Expand Down Expand Up @@ -716,14 +716,24 @@
set THISDIR = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/
if (! -e $THISDIR ) mkdir -p $THISDIR

set rstf = ${{MODEL}}
if (-f ${{rstf}}${{ENSID}}_internal_checkpoint ) then
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_internal_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
/bin/mv ${{rstf}}${{ENSID}}_internal_checkpoint $tmp_file
/bin/rm -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst
/bin/ln -rs $tmp_file $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst
set rstfs = (${{LANDMODEL}} 'landice')
foreach rstf ( $rstfs )
if (-f ${{rstf}}${{ENSID}}_internal_checkpoint ) then
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_internal_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
/bin/mv ${{rstf}}${{ENSID}}_internal_checkpoint $tmp_file
/bin/rm -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst
/bin/ln -rs $tmp_file $EXPDIR/input/restart/${{rstf}}${{ENSID}}_internal_rst
endif
end

set rstf = 'landassim_obspertrseed'
if (-f ${{rstf}}${{ENSID}}_checkpoint ) then
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
/bin/mv ${{rstf}}${{ENSID}}_checkpoint $tmp_file
/bin/rm -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_rst
/bin/ln -rs $tmp_file $EXPDIR/input/restart/${{rstf}}${{ENSID}}_rst
endif

set rstf = 'landpert'
if (-f ${{rstf}}${{ENSID}}_internal_checkpoint ) then
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_internal_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
Expand All @@ -737,28 +747,22 @@
/usr/bin/gzip $old_rst &
endif

set rstf = 'landassim_obspertrseed'
if (-f ${{rstf}}${{ENSID}}_checkpoint ) then
set tmp_file = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{eYEAR}}/M${{eMON}}/${{EXPID}}.${{rstf}}_rst.${{eYEAR}}${{eMON}}${{eDAY}}_${{eHour}}${{eMin}}
/bin/mv ${{rstf}}${{ENSID}}_checkpoint $tmp_file
/bin/rm -f $EXPDIR/input/restart/${{rstf}}${{ENSID}}_rst
/bin/ln -rs $tmp_file $EXPDIR/input/restart/${{rstf}}${{ENSID}}_rst
endif
# move intermediate check point files to output/$EXPDOMAIN/rs/$ENSDIR/Yyyyy/Mmm/ directories
# -------------------------------------------------------------------------------------------

set rstfiles1 = `ls ${{MODEL}}${{ENSID}}_internal_checkpoint.*`
set rstfiles1 = `ls ${{LANDMODEL}}${{ENSID}}_internal_checkpoint.*`
set rstfiles2 = `ls landpert${{ENSID}}_internal_checkpoint.*`
set rstfiles3 = `ls landassim_obspertrseed${{ENSID}}_checkpoint.*`
set rstfiles4 = `ls landice${{ENSID}}_internal_checkpoint.*`

foreach rfile ( $rstfiles1 )
foreach rfile ( $rstfiles1 $rstfiles4 )
set ThisTime = `echo $rfile | rev | cut -d'.' -f2 | rev`
set TY = `echo $ThisTime | cut -c1-4`
set TM = `echo $ThisTime | cut -c5-6`
set THISDIR = $EXPDIR/output/$EXPDOMAIN/rs/$ENSDIR/Y${{TY}}/M${{TM}}/
if (! -e $THISDIR ) mkdir -p $THISDIR
/bin/mv $rfile ${{THISDIR}}${{EXPID}}.${{MODEL}}_internal_rst.${{ThisTime}}.nc4
/usr/bin/gzip ${{THISDIR}}${{EXPID}}.${{MODEL}}_internal_rst.${{ThisTime}}.nc4 &
/bin/mv $rfile ${{THISDIR}}${{EXPID}}.${{LANDMODEL}}_internal_rst.${{ThisTime}}.nc4
/usr/bin/gzip ${{THISDIR}}${{EXPID}}.${{LANDMODEL}}_internal_rst.${{ThisTime}}.nc4 &
end

foreach rfile ( $rstfiles2 )
Expand Down
79 changes: 59 additions & 20 deletions GEOSldas_App/preprocess_ldas.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
program main

use preprocess_ldas_routines, ONLY: &
createf2g, &
createLocalTilefile, &
createLocalBC, &
createLocalVegRestart, &
createLocalmwRTMRestart, &
createLocalCatchRestart, &
create_mapping, &
createZoominTilefile, &
createZoominBC, &
createZoominVegRestart, &
createZoominRestart, &
correctEase, &
convert_pert_rst, &
optimize_latlon
Expand All @@ -26,6 +25,7 @@ program main
character(len=512) :: arg6
character(len=512) :: arg7
character(len=512) :: arg8
character(len=512) :: arg9

character(len=512) :: orig_tile
character(len=512) :: new_tile
Expand All @@ -46,6 +46,8 @@ program main
character(len=512) :: f2g_file
character(len=12 ) :: ymdhm
character(len=12 ) :: SURFLAY
character(len=:), allocatable :: new_r, orig_r
integer, allocatable :: int_types(:)

call get_command_argument(1,option)
call get_command_argument(2,arg1)
Expand All @@ -56,6 +58,7 @@ program main
call get_command_argument(7,arg6)
call get_command_argument(8,arg7)
call get_command_argument(9,arg8)
call get_command_argument(10,arg9)

if( trim(option) == "c_f2g") then

Expand All @@ -71,46 +74,56 @@ program main
SURFLAY = trim(adjustl(arg7))
f2g_file = arg8

call createf2g(orig_tile,domain_def_file,trim(out_path),catch_def_file,trim(exp_id),ymdhm, SURFLAY, f2g_file)
call get_tile_types(trim(arg9), int_types)

call create_mapping(orig_tile,domain_def_file,trim(out_path),catch_def_file,trim(exp_id),ymdhm, SURFLAY, f2g_file, int_types)

else if (trim(option) == "c_localtile") then
else if (trim(option) == "zoomin_tile") then

orig_tile = arg1
new_tile = arg2
f2g_file = arg3
call createLocalTilefile(f2g_file, orig_tile,new_tile)
call createZoominTilefile(f2g_file, orig_tile,new_tile)

else if (trim(option) == "c_localbc" ) then
else if (trim(option) == "zoomin_bc" ) then

orig_BC = arg1
new_BC = arg2
f2g_file = arg3

call createLocalBC(f2g_file, orig_BC, new_BC)
call createZoominBC(f2g_file, orig_BC, new_BC)

else if (trim(option) == "c_localvegrst") then
else if (trim(option) == "zoomin_vegrst") then

orig_veg = arg1
new_veg = arg2
f2g_file = arg3

call createLocalVegRestart(f2g_file, orig_veg, new_veg)
call createZoominVegRestart(f2g_file, orig_veg, new_veg)

else if (trim(option) == "c_localmwrtmrst") then
else if (trim(option) == "zoomin_mwrtmrst") then

orig_rtm = arg1
new_rtm = arg2
f2g_file = arg3

call createLocalmwRTMRestart(f2g_file, orig_rtm, new_rtm)
call createZoominRestart(f2g_file, orig_rtm, new_rtm, 100)

else if (trim(option) == "c_localcatchrst") then
else if (trim(option) == "zoomin_catchrst") then

orig_catch = arg1
new_catch = arg2
f2g_file = arg3

call createLocalCatchRestart(f2g_file, orig_catch, new_catch)
call createZoominRestart(f2g_file, orig_catch, new_catch, 100)

else if (trim(option) == "zoomin_landicerst") then

orig_r = trim(arg1)
new_r = trim(arg2)
f2g_file = trim(arg3)

call createZoominRestart(f2g_file, orig_r, new_r, 20)

else if (trim(option)=="correctease") then

Expand All @@ -128,15 +141,41 @@ program main

else if (trim(option) == "optimize") then


call optimize_latlon(arg1,arg2, arg3, arg4)
call get_tile_types(trim(arg5), int_types)
call optimize_latlon(arg1,arg2, arg3, arg4, int_types)

else

print*, " wrong preprocess option:",option

end if


contains

subroutine get_tile_types(str_types, int_types)
character(*), intent(in) :: str_types
integer, allocatable, intent(out) :: int_types(:)
integer :: n, Length, from, to, i
n = 1
Length = len(str_types)
do i = 1, Length
if (str_types(i:i) == '_') n = n+1
enddo
allocate(int_types(n))
from = 0
to = 1
n = 1
do while (to <= Length)
if (str_types(to:to) == "_") then
read (unit=str_types(from+1:to-1),fmt=*) int_types(n)
n = n + 1
from = to
endif
to = to + 1
enddo
read (unit=str_types(from+1:to-1),fmt=*) int_types(n)
end subroutine get_tile_types

end program main

! ====================== EOF =======================================================
Loading