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

remove unneeded fields for dev/ufs-weather-model #1317

Draft
wants to merge 40 commits into
base: dev/ufs-weather-model
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
31d7f36
clean branch for pio work
DeniseWorthen Aug 28, 2024
0fe584a
add new files
DeniseWorthen Aug 28, 2024
099645b
rename w3iogoncmd as wav_history_mod
DeniseWorthen Aug 28, 2024
c7a9ee3
rework order to enable PIO initialization
DeniseWorthen Aug 28, 2024
0ece778
clean up w3iors, ascii and config variables
DeniseWorthen Aug 28, 2024
efd5774
prevent mpi_startalls if restartnc is active
DeniseWorthen Aug 28, 2024
3b038ff
move setting of flpart flag
DeniseWorthen Aug 29, 2024
6e32b5f
remove unneeded CESMCOUPLED from w3iorsmd
DeniseWorthen Aug 30, 2024
9976c4d
update nc block location, add log messages
DeniseWorthen Aug 31, 2024
32c5f25
use pio_ioformat for create mode
DeniseWorthen Sep 1, 2024
4edfbc6
make iosys a pointer, add debug level config
DeniseWorthen Sep 1, 2024
fbeb83e
fix ww3 thrd cases
DeniseWorthen Sep 2, 2024
5aedf8c
remove stray bin2nc ifdef
DeniseWorthen Sep 3, 2024
4f62341
fixes for logs and wav_history
DeniseWorthen Sep 6, 2024
553f1b1
resolve issue for binary history files
DeniseWorthen Sep 9, 2024
8d0f170
fix multiple writes when waves are in slow loop
DeniseWorthen Sep 10, 2024
9cb49d1
rename oldst2 variable in wav_restart
DeniseWorthen Sep 11, 2024
4674dae
add verbose log option
DeniseWorthen Sep 16, 2024
7c43376
add optional restart files via nml
DeniseWorthen Sep 20, 2024
f9531d0
resolve issue w/ nml for extra fields
DeniseWorthen Sep 21, 2024
ad51cd6
add generic read/write for added restart fields
DeniseWorthen Sep 22, 2024
d92e9ff
fix generic read/write in wav_restart
DeniseWorthen Sep 23, 2024
e0134de
initialize variables
DeniseWorthen Sep 26, 2024
6465186
replace statically allocated arrays to reduce memory
DeniseWorthen Oct 1, 2024
e556ea8
Merge remote-tracking branch 'origin/feature/reducememuse_triamd' int…
DeniseWorthen Oct 2, 2024
008272c
in wav_restart, make arrays allocatable
DeniseWorthen Oct 2, 2024
9b0f44c
write va in nspec loop
DeniseWorthen Oct 7, 2024
e690219
fix compile error
DeniseWorthen Oct 7, 2024
91f1111
Merge branch 'dev/ufs-weather-model' into feature/pio4ww3
DeniseWorthen Oct 8, 2024
c25510f
Merge branch 'dev/ufs-weather-model' into feature/debugsubset
DeniseWorthen Oct 8, 2024
cc7e41c
make dofs i*8 arrays
DeniseWorthen Oct 8, 2024
39b3d90
whitespace cleanup
DeniseWorthen Oct 8, 2024
6dfa4a8
write/read each nspec separately
DeniseWorthen Oct 8, 2024
28b148d
fix dimension error
DeniseWorthen Oct 8, 2024
bd26c2a
fix calculation of dof3d for large meshes
DeniseWorthen Oct 10, 2024
4819e55
Merge branch 'feature/debugsubset_multifld' into feature/pio4ww3
DeniseWorthen Oct 15, 2024
6f28c27
add error checks for dimensions in restart file
DeniseWorthen Oct 15, 2024
06c2099
fix deallocation issue when dbug_flag>5
DeniseWorthen Oct 22, 2024
908c105
minimize allocated forcing fields when using cmeps
DeniseWorthen Nov 6, 2024
4cd19a2
Merge branch 'dev/ufs-weather-model' into HEAD
DeniseWorthen Nov 14, 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
42 changes: 24 additions & 18 deletions model/src/w3adatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
#ifdef W3_S
USE W3SERVMD, ONLY: STRACE
#endif
use w3odatmd, only : use_cmeps
!
!/
!/ ------------------------------------------------------------------- /
Expand All @@ -949,11 +950,12 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
!/ Local parameters
!/
INTEGER :: JGRID, NXXX, NSEAL_tmp
integer :: memunit
integer :: allocsize
#ifdef W3_S
INTEGER, SAVE :: IENT = 0
CALL STRACE (IENT, 'W3DIMA')
#endif
integer :: memunit
!
! -------------------------------------------------------------------- /
! 1. Test input and module status
Expand Down Expand Up @@ -1332,40 +1334,44 @@ SUBROUTINE W3DIMA ( IMOD, NDSE, NDST, D_ONLY )
ALLOCATE (WADATS(IMOD)%IC3CG(0:NK+1,0:300), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
#endif

if (use_cmeps) then
allocsize = 1
else
allocsize = nsea
end if
!
IF ( FLCUR ) THEN
ALLOCATE ( WADATS(IMOD)%CA0(NSEA) , &
WADATS(IMOD)%CAI(NSEA) , &
WADATS(IMOD)%CD0(NSEA) , &
WADATS(IMOD)%CDI(NSEA) , &
ALLOCATE ( WADATS(IMOD)%CA0(allocsize) , &
WADATS(IMOD)%CAI(allocsize) , &
WADATS(IMOD)%CD0(allocsize) , &
WADATS(IMOD)%CDI(allocsize) , &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
IF ( FLWIND ) THEN
ALLOCATE ( WADATS(IMOD)%UA0(NSEA) , &
WADATS(IMOD)%UAI(NSEA) , &
WADATS(IMOD)%UD0(NSEA) , &
WADATS(IMOD)%UDI(NSEA) , &
WADATS(IMOD)%AS0(NSEA) , &
WADATS(IMOD)%ASI(NSEA) , &
ALLOCATE ( WADATS(IMOD)%UA0(allocsize) , &
WADATS(IMOD)%UAI(allocsize) , &
WADATS(IMOD)%UD0(allocsize) , &
WADATS(IMOD)%UDI(allocsize) , &
WADATS(IMOD)%AS0(allocsize) , &
WADATS(IMOD)%ASI(allocsize) , &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
IF ( FLTAUA ) THEN
ALLOCATE ( WADATS(IMOD)%MA0(NSEA) , &
WADATS(IMOD)%MAI(NSEA) , &
WADATS(IMOD)%MD0(NSEA) , &
WADATS(IMOD)%MDI(NSEA) , &
ALLOCATE ( WADATS(IMOD)%MA0(allocsize) , &
WADATS(IMOD)%MAI(allocsize) , &
WADATS(IMOD)%MD0(allocsize) , &
WADATS(IMOD)%MDI(allocsize) , &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
IF ( FLRHOA ) THEN
ALLOCATE ( WADATS(IMOD)%RA0(NSEA) , &
WADATS(IMOD)%RAI(NSEA) , &
ALLOCATE ( WADATS(IMOD)%RA0(allocsize) , &
WADATS(IMOD)%RAI(allocsize) , &
STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
Expand Down
71 changes: 40 additions & 31 deletions model/src/w3idatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
#ifdef W3_S
USE W3SERVMD, ONLY: STRACE
#endif
use w3odatmd, only : use_cmeps
!
IMPLICIT NONE
!/
Expand All @@ -521,6 +522,7 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
!/
INTEGER :: JGRID
LOGICAL :: FLAGSTIDE(4)=.FALSE.
integer :: allocsizex, allocsizey
#ifdef W3_S
INTEGER, SAVE :: IENT = 0
CALL STRACE (IENT, 'W3DIMI')
Expand Down Expand Up @@ -631,19 +633,26 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
!
if (use_cmeps) then
allocsizex = 1
allocsizey = 1
else
allocsizex = nx
allocsizey = ny
end if
IF ( FLCUR ) THEN
#ifdef W3_SMC
IF( FSWND ) THEN
ALLOCATE ( INPUTS(IMOD)%CX0(NSEA,1) , &
INPUTS(IMOD)%CY0(NSEA,1) , &
INPUTS(IMOD)%CXN(NSEA,1) , &
ALLOCATE ( INPUTS(IMOD)%CX0(NSEA,1) , &
INPUTS(IMOD)%CY0(NSEA,1) , &
INPUTS(IMOD)%CXN(NSEA,1) , &
INPUTS(IMOD)%CYN(NSEA,1) , STAT=ISTAT )
ELSE
#endif
ALLOCATE ( INPUTS(IMOD)%CX0(NX,NY) , &
INPUTS(IMOD)%CY0(NX,NY) , &
INPUTS(IMOD)%CXN(NX,NY) , &
INPUTS(IMOD)%CYN(NX,NY) , STAT=ISTAT )
ALLOCATE ( INPUTS(IMOD)%CX0(NX,NY) , &
INPUTS(IMOD)%CY0(NX,NY) , &
INPUTS(IMOD)%CXN(ALLOCSIZEX,ALLOCSIZEY) , &
INPUTS(IMOD)%CYN(ALLOCSIZEX,ALLOCSIZEY) , STAT=ISTAT )
#ifdef W3_SMC
ENDIF
#endif
Expand All @@ -657,7 +666,7 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
END IF
!
IF ( FLCURTIDE ) THEN
ALLOCATE ( INPUTS(IMOD)%CXTIDE(NX,NY,NTIDE,2), &
ALLOCATE ( INPUTS(IMOD)%CXTIDE(NX,NY,NTIDE,2), &
INPUTS(IMOD)%CYTIDE(NX,NY,NTIDE,2), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
END IF
Expand All @@ -666,7 +675,7 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )

#ifdef W3_WRST
IF(.NOT.(INPUTS(IMOD)%WRSTIINIT)) THEN
ALLOCATE ( INPUTS(IMOD)%WXNwrst(NX,NY) , &
ALLOCATE ( INPUTS(IMOD)%WXNwrst(NX,NY) , &
INPUTS(IMOD)%WYNwrst(NX,NY) , STAT=ISTAT )
INPUTS(IMOD)%WRSTIINIT=.TRUE.
ENDIF
Expand All @@ -675,20 +684,20 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
IF ( FLWIND ) THEN
#ifdef W3_SMC
IF( FSWND ) THEN
ALLOCATE ( INPUTS(IMOD)%WX0(NSEA,1) , &
INPUTS(IMOD)%WY0(NSEA,1) , &
INPUTS(IMOD)%DT0(NSEA,1) , &
INPUTS(IMOD)%WXN(NSEA,1) , &
INPUTS(IMOD)%WYN(NSEA,1) , &
ALLOCATE ( INPUTS(IMOD)%WX0(NSEA,1) , &
INPUTS(IMOD)%WY0(NSEA,1) , &
INPUTS(IMOD)%DT0(NSEA,1) , &
INPUTS(IMOD)%WXN(NSEA,1) , &
INPUTS(IMOD)%WYN(NSEA,1) , &
INPUTS(IMOD)%DTN(NSEA,1) , STAT=ISTAT )
ELSE
#endif
ALLOCATE ( INPUTS(IMOD)%WX0(NX,NY) , &
INPUTS(IMOD)%WY0(NX,NY) , &
INPUTS(IMOD)%DT0(NX,NY) , &
INPUTS(IMOD)%WXN(NX,NY) , &
INPUTS(IMOD)%WYN(NX,NY) , &
INPUTS(IMOD)%DTN(NX,NY) , STAT=ISTAT )
ALLOCATE ( INPUTS(IMOD)%WX0(NX,NY) , &
INPUTS(IMOD)%WY0(NX,NY) , &
INPUTS(IMOD)%DT0(NX,NY) , &
INPUTS(IMOD)%WXN(ALLOCSIZEX,ALLOCSIZEY) , &
INPUTS(IMOD)%WYN(ALLOCSIZEX,ALLOCSIZEY) , &
INPUTS(IMOD)%DTN(ALLOCSIZEX,ALLOCSIZEY) , STAT=ISTAT )
#ifdef W3_SMC
ENDIF
#endif
Expand All @@ -698,7 +707,7 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
END IF
!
IF ( FLICE ) THEN
ALLOCATE ( INPUTS(IMOD)%ICEI(NX,NY), &
ALLOCATE ( INPUTS(IMOD)%ICEI(NX,NY), &
INPUTS(IMOD)%BERGI(NX,NY), STAT=ISTAT )
CHECK_ALLOC_STATUS ( ISTAT )
INPUTS(IMOD)%BERGI = 0.
Expand All @@ -707,16 +716,16 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
IF ( FLTAUA ) THEN
#ifdef W3_SMC
IF( FSWND ) THEN
ALLOCATE ( INPUTS(IMOD)%UX0(NSEA,1) , &
INPUTS(IMOD)%UY0(NSEA,1) , &
INPUTS(IMOD)%UXN(NSEA,1) , &
ALLOCATE ( INPUTS(IMOD)%UX0(NSEA,1) , &
INPUTS(IMOD)%UY0(NSEA,1) , &
INPUTS(IMOD)%UXN(NSEA,1) , &
INPUTS(IMOD)%UYN(NSEA,1) , STAT=ISTAT )
ELSE
#endif
ALLOCATE ( INPUTS(IMOD)%UX0(NX,NY) , &
INPUTS(IMOD)%UY0(NX,NY) , &
INPUTS(IMOD)%UXN(NX,NY) , &
INPUTS(IMOD)%UYN(NX,NY) , STAT=ISTAT )
ALLOCATE ( INPUTS(IMOD)%UX0(NX,NY) , &
INPUTS(IMOD)%UY0(NX,NY) , &
INPUTS(IMOD)%UXN(ALLOCSIZEX,ALLOCSIZEY) , &
INPUTS(IMOD)%UYN(ALLOCSIZEX,ALLOCSIZEY) , STAT=ISTAT )
#ifdef W3_SMC
ENDIF
#endif
Expand All @@ -726,12 +735,12 @@ SUBROUTINE W3DIMI ( IMOD, NDSE, NDST, FLAGSTIDEIN )
IF ( FLRHOA ) THEN
#ifdef W3_SMC
IF( FSWND ) THEN
ALLOCATE ( INPUTS(IMOD)%RH0(NSEA,1) , &
ALLOCATE ( INPUTS(IMOD)%RH0(NSEA,1) , &
INPUTS(IMOD)%RHN(NSEA,1) , STAT=ISTAT )
ELSE
#endif
ALLOCATE ( INPUTS(IMOD)%RH0(NX,NY) , &
INPUTS(IMOD)%RHN(NX,NY) , STAT=ISTAT )
ALLOCATE ( INPUTS(IMOD)%RH0(NX,NY) , &
INPUTS(IMOD)%RHN(ALLOCSIZEX,ALLOCSIZEY) , STAT=ISTAT )
#ifdef W3_SMC
ENDIF
#endif
Expand Down
1 change: 1 addition & 0 deletions model/src/w3odatmd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ MODULE W3ODATMD
character(len=36) :: time_origin = '' !< @public the time_origin used for netCDF output
character(len=36) :: calendar_name = '' !< @public the calendar used for netCDF output
integer(kind=8) :: elapsed_secs = 0 !< @public the time in seconds from the time_origin
logical :: use_cmeps = .false. !< @public a logical flag to indicate cmeps is providing the forcing
!/
CONTAINS
!/ ------------------------------------------------------------------- /
Expand Down
Loading
Loading