Skip to content

Commit e0b61d0

Browse files
JessicaMeixner-NOAAaliabdolali
authored andcommitted
Add option for reading wind from restart for wmesmf and a few other things (NOAA-EMC#109)
* superscript to registered trademark in README * Branch esmf_hybrid: Adding hybrid compile options for OMP threading in esmf build for NEMS app. * Branch esmf_hybrid: fixing makefile bug for completing make process in esmf area. * updating w3_make for esmf for hybrid compile option (NOAA-EMC#78) updating esmf makefile for option to only build library updating switch to remove FLD2 which is only used for 2way coupling * spaces to tab in makefile for esmf * updating comp/link for theia issue for hybrid compilation * Adding to skip files in matrix.comp Github Issue NOAA-EMC#87 * Removing T400 until parameters can be confirmed and updated * removing a temp manual file and adding to git ignore list * Adding hera for NEMS coupled application builds * more hera updates for NEMS * adding wind restarts for esmf issues * updates for proper indexing of tw* and bug fixes plus debug statements to be removed after more testing * adding implicit none to wmesmf * removing w3tide computed gotos - update from Mickael * remove computed goto * bugfix for w3iors * adding WXNwrst because WXN/WYN are not allocated yet * removing debug write statements * adding wrst to manual * adding WRST to w3_new * when WRST is allocated a second time it was zeroing out field so a variable was added to make sure it was only allocated once
1 parent 5eaa609 commit e0b61d0

18 files changed

+285
-98
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ manual/ww3_systrk.tex
3333
manual/ww3_uprstr.tex
3434
manual/ww3_grib.tex
3535
manual/ww3_gint.tex
36+
manual/ww3_trnc.tex
3637
manual/gx_outf.tex
3738
manual/gx_outp.tex
3839
manual/*.log

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The WAVEWATCH III Framework
22

3-
WAVEWATCH III ® is a community wave modeling framework that includes the
3+
WAVEWATCH III<sup>&reg;</sup> is a community wave modeling framework that includes the
44
latest scientific advancements in the field of wind-wave modeling and dynamics.
55

66
## General Features
@@ -11,11 +11,11 @@ for shallow-water (surf zone) applications, as well as wetting and drying of
1111
grid points. Propagation of a wave spectrum can be solved using regular
1212
(rectilinear or curvilinear) and unstructured (triangular) grids. See
1313
[About WW3](https://github.com/NOAA-EMC/WW3/wiki/About-WW3) for a
14-
detailed description of WAVEWATCH III &reg;.
14+
detailed description of WAVEWATCH III<sup>&reg;</sup> .
1515

1616
## Installation
1717

18-
The WAVEWATCH III framework package has two parts that need to be combined so
18+
The WAVEWATCH III<sup>&reg;</sup> framework package has two parts that need to be combined so
1919
all runs smoothly: the GitHub repo itself, and a binary data file bundle that
2020
needs to be obtained from our ftp site. Steps to successfully acquire and install
2121
the framework are outlined in our [Quick Start](https://github.com/NOAA-EMC/WW3/wiki/Quick-Start)

manual/app/nuopc.tex

+4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ \subsection{~Building and Installing the NUOPC Cap} \label{sec:nuopcbuild}
2525
this makefile will subsequently call {\code w3\_make}. As part of this process a nuopc.mk makefile
2626
fragment will also be created, which tells NUOPC/ESMF where the \ws\ library is located.
2727

28+
Note there is a new switch {\code WRST} which will add 10 m wind to the restart file and use that wind field
29+
at the initial time step of the wave model. This can be used in situations where the coupled atmospheric model
30+
does not have 10 m wind speeds at initialization.
31+
2832
\vssub
2933
\subsection{~Import/Export Fields in the NUOPC Cap} \label{sec:nuopcfields}
3034
\vssub

manual/eqs/ST4.tex

+89-44
Large diffs are not rendered by default.

manual/impl/switch.tex

+1
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,7 @@ \subsubsection{~Optional switches} \label{sub:opt_switch}
365365
NetCDF-3 files. Selecting both TRKNC and NC4 will generate
366366
NetCDF-4 files.}
367367
\sit{uost}{Enable the unresolved obstacles source term.}
368+
\sit{wrst}{Save wind in restart and use in first time step in wmesmf.}
368369
\sit{xw0 }{Swell diffusion only in \uq\ scheme.}
369370
\sit{xw1 }{Id. wave growth diffusion only.}
370371
\end{slist}

manual/ww3_trnc.tex

-24
This file was deleted.

model/bin/comp.theia

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
# open mpi implementation
107107
if [ "$omp_mod" = 'yes' ]
108108
then
109-
opt="$opt -openmp"
109+
opt="$opt -qopenmp"
110110
fi
111111

112112
# oasis coupler include dir

model/bin/link.theia

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
# open mpi implementation
110110
if [ "$omp_mod" = 'yes' ]
111111
then
112-
opt="$opt -openmp"
112+
opt="$opt -qopenmp"
113113
fi
114114

115115
# oasis coupler archive

model/bin/make_makefile.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
dstress s_ice s_is reflection s_xx \
100100
wind windx wcor rwind curr currx mgwind mgprop mggse \
101101
subsec tdyn dss0 pdif tide refrx ig rotag arctic nnt mprf \
102-
cou oasis agcm ogcm igcm trknc setup pdlib memck uost
102+
cou oasis agcm ogcm igcm trknc setup pdlib memck uost rstwind
103103
do
104104
case $type in
105105
#sort:mach:
@@ -257,6 +257,13 @@
257257
ID='wind vs. current definition'
258258
TS='RWND'
259259
OK='RWND' ;;
260+
261+
#sort:rstwind:
262+
rstwind ) TY='upto1'
263+
ID='wind in restart for wmesmf'
264+
TS='WRST'
265+
OK='WRST' ;;
266+
260267
#sort:curr:
261268
curr ) TY='one'
262269
ID='current interpolation in time'

model/bin/w3_make

+8-2
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,14 @@ EOF
709709
if [ -n "`echo $prog | grep esmf 2>/dev/null`" ]
710710
then
711711
mkfile=$main_dir/nuopc.mk
712-
mod_dir=$main_dir/mod_MPI
713-
obj_dir=$main_dir/obj_MPI
712+
if [ -n "`grep OMP $switch_file`" ]
713+
then
714+
mod_dir=$main_dir/mod_HYB
715+
obj_dir=$main_dir/obj_HYB
716+
else
717+
mod_dir=$main_dir/mod_MPI
718+
obj_dir=$main_dir/obj_MPI
719+
fi
714720
rm -f $mkfile
715721
touch $mkfile
716722
echo "#-----------------------------------------------" >> $mkfile

model/bin/w3_new

+3
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@
320320
touch w3gdatmd.ftn
321321
touch w3iogrmd.ftn
322322
touch ww3_grid.ftn ;;
323+
'rstwind') cd $main_dir/ftn ; touch wmesmfmd.ftn
324+
touch w3idatmd.ftn
325+
touch w3iorsmd.ftn ;;
323326
'curr' ) cd $main_dir/ftn ; touch w3updtmd.ftn
324327
touch ww3_prnc.ftn
325328
touch ww3_prep.ftn ;;

model/esmf/Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ ww3_nems: env setup gout switch
8989
$(WW3_BINDIR)/w3_make ww3_multi_esmf
9090
$(WW3_BINDIR)/w3_make ww3_multi
9191

92+
ww3_nemslibonly: env setup switch
93+
$(WW3_BINDIR)/w3_make ww3_multi_esmf
94+
9295
ww3_multi_esmf: esmApp.o $(DEP_LINK_OBJS)
9396
$(ESMF_F90LINKER) $(ESMF_F90LINKOPTS) -o $(EXE) $^ \
9497
$(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) $(ESMF_F90ESMFLINKLIBS)
@@ -157,6 +160,8 @@ switch:
157160
gout:
158161
@echo "$(SWITCHES)" > $(WW3_BINDIR)/tempswitch
159162
@sed -e "s/DIST/SHRD/g"\
163+
-e "s/OMPG/ /g"\
164+
-e "s/OMPH/ /g"\
160165
-e "s/MPIT/ /g"\
161166
-e "s/MPI/ /g"\
162167
-e "s/PDLIB/ /g"\
@@ -172,6 +177,8 @@ gout:
172177
$(WW3_BINDIR)/w3_make ww3_ounp
173178
@echo "$(SWITCHES)" > $(WW3_BINDIR)/tempswitch
174179
@sed -e "s/DIST/SHRD/g"\
180+
-e "s/OMPG/ /g"\
181+
-e "s/OMPH/ /g"\
175182
-e "s/MPIT/ /g"\
176183
-e "s/MPI/ /g"\
177184
-e "s/PDLIB/ /g"\

model/esmf/switch

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ DIST
55
MPI
66
SCRIP
77
SCRIPNC
8+
WRST
89
NC4
910
PR3
1011
UQ
1112
FLX0
1213
SEED
13-
FLD2
1414
ST4
1515
STAB0
1616
NL1

model/ftn/w3idatmd.ftn

+13
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@
149149
INTEGER :: TFN(2,-7:8), TC0(2), TW0(2), &
150150
TDN(2), TG0(2)
151151
REAL :: GA0, GD0, GAN, GDN
152+
!/WRST REAL, POINTER :: WXNwrst(:,:),WYNwrst(:,:)
152153
REAL, POINTER :: WX0(:,:), WY0(:,:), DT0(:,:), &
153154
WXN(:,:), WYN(:,:), DTN(:,:), &
154155
CX0(:,:), CY0(:,:), CXN(:,:), &
@@ -159,6 +160,7 @@
159160
!/TIDE REAL, POINTER :: CXTIDE(:,:,:,:), CYTIDE(:,:,:,:), &
160161
!/TIDE WLTIDE(:,:,:,:)
161162
LOGICAL :: IINIT
163+
!/WRST LOGICAL :: WRSTIINIT=.FALSE.
162164
! note that if size of INFLAGS1 is changed, then TFLAGS in wminitmd.ftn
163165
! also must be resized.
164166
LOGICAL :: INFLAGS1(-7:12), FLAGSC(-7:12), &
@@ -179,6 +181,7 @@
179181
REAL, POINTER :: GA0, GD0, GAN, GDN
180182
REAL, POINTER :: WX0(:,:), WY0(:,:), DT0(:,:), &
181183
WXN(:,:), WYN(:,:), DTN(:,:), &
184+
!/WRST WXNwrst(:,:),WYNwrst(:,:), &
182185
CX0(:,:), CY0(:,:), CXN(:,:), &
183186
CYN(:,:), WLEV(:,:), ICEI(:,:), &
184187
BERGI(:,:), MUDT(:,:), MUDV(:,:), &
@@ -527,6 +530,13 @@
527530
!/TIDE CHECK_ALLOC_STATUS ( ISTAT )
528531
!/TIDE END IF
529532
!
533+
534+
!/WRST IF(.NOT.(INPUTS(IMOD)%WRSTIINIT)) THEN
535+
!/WRST ALLOCATE ( INPUTS(IMOD)%WXNwrst(NX,NY) , &
536+
!/WRST INPUTS(IMOD)%WYNwrst(NX,NY) , STAT=ISTAT )
537+
!/WRST INPUTS(IMOD)%WRSTIINIT=.TRUE.
538+
!/WRST ENDIF
539+
530540
IF ( FLWIND ) THEN
531541
!/SMC IF( FSWND ) THEN
532542
!/SMC ALLOCATE ( INPUTS(IMOD)%WX0(NSEA,1) , &
@@ -795,6 +805,9 @@
795805
!/TIDE CYTIDE => INPUTS(IMOD)%CYTIDE
796806
!/TIDE END IF
797807
!
808+
!/WRST WXNwrst => INPUTS(IMOD)%WXNwrst
809+
!/WRST WYNwrst => INPUTS(IMOD)%WYNwrst
810+
798811
IF ( FLWIND ) THEN
799812
WX0 => INPUTS(IMOD)%WX0
800813
WY0 => INPUTS(IMOD)%WY0

model/ftn/w3iorsmd.ftn

+52-6
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@
234234
GNAME, FILEXT, GTYPE, UNGTYPE
235235
USE W3TRIAMD, ONLY: SETUGIOBP
236236
USE W3WDATMD
237+
!/WRST USE W3IDATMD, ONLY: WXN, WYN, W3SETI
238+
!/WRST USE W3IDATMD, ONLY: WXNwrst, WYNwrst
237239
USE W3ODATMD, ONLY: NDSE, NDST, IAPROC, NAPROC, NAPERR, NAPRST, &
238240
IFILE => IFILE4, FNMPRE, NTPROC, IOSTYP
239241
!/MPI USE W3ODATMD, ONLY: NRQRS, NBLKRS, RSBLKS, IRQRS, IRQRSS, VAAUX
@@ -270,7 +272,7 @@
270272
INTEGER :: IGRD, I, J, LRECL, NSIZE, IERR, &
271273
NSEAT, MSPEC, TTIME(2), ISEA, JSEA, &
272274
NREC, NPART, IPART, IX, IY, IXL, IP, &
273-
NPRTX2
275+
NPRTX2, NPRTY2, IYL
274276
INTEGER, ALLOCATABLE :: MAPTMP(:,:)
275277
!/S INTEGER, SAVE :: IENT = 0
276278
!/MPI INTEGER :: IERR_MPI, IH, IB, ISEA0, ISEAN, &
@@ -279,6 +281,7 @@
279281
!/MPI INTEGER, ALLOCATABLE :: STAT1(:,:), STAT2(:,:)
280282
!/MPI REAL, ALLOCATABLE :: VGBUFF(:), VLBUFF(:)
281283
REAL(KIND=LRB), ALLOCATABLE :: WRITEBUFF(:)
284+
282285
LOGICAL :: WRITE, IOSFLG
283286
CHARACTER(LEN=4) :: TYPE
284287
CHARACTER(LEN=10) :: VERTST
@@ -313,6 +316,7 @@
313316
CALL W3SETO ( IGRD, NDSE, NDST )
314317
CALL W3SETG ( IGRD, NDSE, NDST )
315318
CALL W3SETW ( IGRD, NDSE, NDST )
319+
!/WRST CALL W3SETI ( IGRD, NDSE, NDST )
316320
!
317321
IF (INXOUT.NE.'READ' .AND. INXOUT.NE.'HOT' .AND. &
318322
INXOUT.NE.'COLD' .AND. INXOUT.NE.'WIND' .AND. &
@@ -684,6 +688,7 @@
684688
NREC = NSEA + 3
685689
NPART = 1 + (NSEA-1)/NSIZE
686690
NPRTX2 = 1 + (NX-1)/NSIZE
691+
NPRTY2 = 1 + (NY-1)/NSIZE
687692
!
688693
!/DEBUGIO WRITE(740+IAPROC,*) 'W3IORS, step 8'
689694
!/DEBUGIO FLUSH(740+IAPROC)
@@ -701,8 +706,8 @@
701706
RPOS = 1_8 + LRECL*(NREC-1_8)
702707
WRITEBUFF(:) = 0.
703708
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF
704-
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) TLEV, TICE
705-
709+
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) &
710+
TLEV, TICE
706711
DO IPART=1,NPART
707712
NREC = NREC + 1
708713
RPOS = 1_8 + LRECL*(NREC-1_8)
@@ -718,7 +723,27 @@
718723
WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) &
719724
(ICE(ISEA),ISEA=1+(IPART-1)*NSIZE, &
720725
MIN(NSEA,IPART*NSIZE))
721-
END DO
726+
END DO
727+
!/WRST DO IX=1, NX
728+
!/WRST DO IPART=1,NPRTY2
729+
!/WRST NREC = NREC + 1
730+
!/WRST RPOS = 1_8 + LRECL*(NREC-1_8)
731+
!/WRST WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF
732+
!/WRST WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) &
733+
!/WRST (WXN(IX,IYL),IYL=1+(IPART-1)*NSIZE, &
734+
!/WRST MIN(NY,IPART*NSIZE))
735+
!/WRST END DO
736+
!/WRST END DO
737+
!/WRST DO IX=1, NX
738+
!/WRST DO IPART=1,NPRTY2
739+
!/WRST NREC = NREC + 1
740+
!/WRST RPOS = 1_8 + LRECL*(NREC-1_8)
741+
!/WRST WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) WRITEBUFF
742+
!/WRST WRITE (NDSR,POS=RPOS,ERR=803,IOSTAT=IERR) &
743+
!/WRST (WYN(IX,IYL),IYL=1+(IPART-1)*NSIZE, &
744+
!/WRST MIN(NY,IPART*NSIZE))
745+
!/WRST END DO
746+
!/WRST END DO
722747
ALLOCATE ( MAPTMP(NY,NX) )
723748
MAPTMP = MAPSTA + 8*MAPST2
724749
DO IY=1, NY
@@ -777,7 +802,8 @@
777802
ELSE
778803
IF (TYPE.EQ.'FULL') THEN
779804
RPOS = 1_8 + LRECL*(NREC-1_8)
780-
READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) TLEV, TICE
805+
READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) &
806+
TLEV, TICE
781807
!/DEBUGINIT WRITE(740+IAPROC,*) 'Before reading WLV'
782808
DO IPART=1,NPART
783809
NREC = NREC + 1
@@ -793,7 +819,25 @@
793819
READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) &
794820
(ICE(ISEA),ISEA=1+(IPART-1)*NSIZE, &
795821
MIN(NSEA,IPART*NSIZE))
796-
END DO
822+
END DO
823+
!/WRST DO IX=1, NX
824+
!/WRST DO IPART=1,NPRTY2
825+
!/WRST NREC = NREC + 1
826+
!/WRST RPOS = 1_8 + LRECL*(NREC-1_8)
827+
!/WRST READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) &
828+
!/WRST (WXNwrst(IX,IYL),IYL=1+(IPART-1)*NSIZE, &
829+
!/WRST MIN(NY,IPART*NSIZE))
830+
!/WRST END DO
831+
!/WRST END DO
832+
!/WRST DO IX=1, NX
833+
!/WRST DO IPART=1,NPRTY2
834+
!/WRST NREC = NREC + 1
835+
!/WRST RPOS = 1_8 + LRECL*(NREC-1_8)
836+
!/WRST READ (NDSR,POS=RPOS,ERR=802,IOSTAT=IERR) &
837+
!/WRST (WYNwrst(IX,IYL),IYL=1+(IPART-1)*NSIZE, &
838+
!/WRST MIN(NY,IPART*NSIZE))
839+
!/WRST END DO
840+
!/WRST END DO
797841
ALLOCATE ( MAPTMP(NY,NX) )
798842
!/DEBUGINIT WRITE(740+IAPROC,*) 'Before reading MAPTMP'
799843
DO IY=1, NY
@@ -859,6 +903,8 @@
859903
TIC1(2) = 0
860904
TIC5(1) = -1
861905
TIC5(2) = 0
906+
!/WRST WXNwrst = 0.
907+
!/WRST WYNwrst = 0.
862908
WLV = 0.
863909
ICE = 0.
864910
ASF = 1.

model/ftn/w3profsmd.ftn

+23-1
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,29 @@ END MODULE W3PROFSMD
20302030
! where to go
20312031
!
20322032
if (ipar(1).gt.0) then
2033-
goto (10, 20, 40, 50, 60, 70, 80, 90, 100, 110) ipar(10)
2033+
!!goto (10, 20, 40, 50, 60, 70, 80, 90, 100, 110) ipar(10)
2034+
SELECT CASE (ipar(10))
2035+
CASE (1)
2036+
GOTO 10
2037+
CASE (2)
2038+
GOTO 20
2039+
CASE (3)
2040+
GOTO 40
2041+
CASE (4)
2042+
GOTO 50
2043+
CASE (5)
2044+
GOTO 60
2045+
CASE (6)
2046+
GOTO 70
2047+
CASE (7)
2048+
GOTO 80
2049+
CASE (8)
2050+
GOTO 90
2051+
CASE (9)
2052+
GOTO 100
2053+
CASE (10)
2054+
GOTO 110
2055+
END SELECT
20342056
else if (ipar(1).lt.0) then
20352057
goto 900
20362058
endif

0 commit comments

Comments
 (0)