WAVEWATCH III  beta 0.0.1
w3gridmd Module Reference

Functions/Subroutines

subroutine w3grid ()
 
subroutine readnl (NDS, NAME, STATUS)
 

Variables

type(nml_spectrum_t) nml_spectrum
 
type(nml_run_t) nml_run
 
type(nml_timesteps_t) nml_timesteps
 
type(nml_grid_t) nml_grid
 
type(nml_rect_t) nml_rect
 
type(nml_curv_t) nml_curv
 
type(nml_unst_t) nml_unst
 
type(nml_smc_t) nml_smc
 
type(nml_depth_t) nml_depth
 
type(nml_mask_t) nml_mask
 
type(nml_obst_t) nml_obst
 
type(nml_slope_t) nml_slope
 
type(nml_sed_t) nml_sed
 
type(nml_inbnd_count_t) nml_inbnd_count
 
type(nml_inbnd_point_t), dimension(:), allocatable nml_inbnd_point
 
type(nml_excl_count_t) nml_excl_count
 
type(nml_excl_point_t), dimension(:), allocatable nml_excl_point
 
type(nml_excl_body_t), dimension(:), allocatable nml_excl_body
 
type(nml_outbnd_count_t) nml_outbnd_count
 
type(nml_outbnd_line_t), dimension(:), allocatable nml_outbnd_line
 
integer, parameter nfl = 6
 
integer ndsi
 
integer ndsi2
 
integer ndss
 
integer ndsm
 
integer ndsg
 
integer ndstr
 
integer ierr
 
integer ndstrc
 
integer ntrace
 
integer ith
 
integer ik
 
integer ith0
 
integer isp
 
integer, dimension(nfliyn
 
integer nrlin
 
integer nrsrce
 
integer nrnl
 
integer nrbt
 
integer nrdb
 
integer nrtr
 
integer nrbs
 
integer nrprop
 
integer idla
 
integer idfm
 
integer ix0
 
integer ixn
 
integer ix
 
integer iy
 
integer isea
 
integer idx
 
integer ixo
 
integer idy
 
integer iyo
 
integer iba
 
integer nba
 
integer iloop
 
integer ifl
 
integer nbotot
 
integer npo
 
integer ip
 
integer ix1
 
integer ix2
 
integer iy1
 
integer iy2
 
integer j
 
integer jj
 
integer, dimension(4) ixr
 
integer, dimension(4) iyr
 
integer, dimension(4) iseai
 
integer ist
 
integer nki
 
integer nthi
 
integer nric
 
integer nris
 
integer i
 
integer idft
 
integer nstat
 
integer nbt
 
integer nland
 
integer nosw
 
integer nmapb
 
integer imapb
 
integer ndsma
 
integer idepth
 
integer ibi
 
integer ip0
 
integer ipn
 
integer iph
 
integer ipi
 
integer ncol = 78
 
integer jeqt
 
integer lvsmc
 
integer nbismc
 
integer js
 
integer ncobst
 
integer jobs
 
integer ishft
 
integer ngui
 
integer ngvj
 
integer naui
 
integer navj
 
integer nmap
 
integer imap
 
integer ix3
 
integer iy3
 
integer ifile
 
integer, save ient = 0
 
integer, dimension(:,:), allocatable tmpsta
 
integer, dimension(:,:), allocatable tmpmap
 
integer, dimension(:,:), allocatable readmp
 
integer, dimension(:,:), allocatable mapout
 
real rxfr
 
real rfr1
 
real sigma
 
real sxfr
 
real fachf
 
real vsc
 
real vsc0
 
real vof
 
real zlim
 
real x
 
real y
 
real xp
 
real xo0
 
real yo0
 
real dxo
 
real dyo
 
real xo
 
real yo
 
real, dimension(4) rd
 
real rdtot
 
real factor
 
real rth0
 
real fmiche
 
real rwndc
 
real wcor1
 
real wcor2
 
character(len=4) gstrg
 
character(len=4) cstrg
 
integer p2sf
 
integer i1p2sf
 
integer i2p2sf
 
integer e3d
 
integer i1e3d
 
integer i2e3d
 
integer us3d
 
integer i1us3d
 
integer i2us3d
 
integer ussp
 
integer iussp
 
integer th1mf
 
integer i1th1m
 
integer i2th1m
 
integer sth1mf
 
integer i1sth1m
 
integer i2sth1m
 
integer th2mf
 
integer i1th2m
 
integer i2th2m
 
integer sth2mf
 
integer i1sth2m
 
integer i2sth2m
 
real, dimension(25) stk_wn
 
real clin
 
real rfpm
 
real rfhf
 
real cinp
 
real cdis
 
real apm
 
real phimin
 
real fpia
 
real fpib
 
real dphid
 
real nlprop
 
real dptfac
 
real, dimension(100) depths
 
real, dimension(500) qparms
 
real a34
 
real fhfc
 
real dnm
 
real fc1
 
real fc2
 
real fc3
 
real gamma
 
real latmin
 
real dvsmc
 
real trnmx
 
real trnmy
 
integer, dimension(:), allocatable nlvcelsk
 
integer, dimension(:), allocatable nlvufcsk
 
integer, dimension(:), allocatable nlvvfcsk
 
integer, dimension(:,:), allocatable ijkcelin
 
integer, dimension(:,:), allocatable ijkufcin
 
integer, dimension(:,:), allocatable ijkvfcin
 
integer, dimension(:), allocatable nbicelin
 
integer, dimension(:,:), allocatable ijkobstr
 
real polonac
 
real polatac
 
integer, dimension(:,:), allocatable ijkcelac
 
integer, dimension(:,:), allocatable ijkufcac
 
integer, dimension(:,:), allocatable ijkvfcac
 
integer, dimension(:), allocatable ijkdep
 
integer, dimension(:), allocatable ijkvfc8
 
real, dimension(:), allocatable xlonac
 
real, dimension(:), allocatable ylatac
 
real, dimension(:), allocatable elonac
 
real, dimension(:), allocatable elatac
 
real, dimension(:,:), allocatable angldin
 
real, dimension(:,:), allocatable stdlon
 
real, dimension(:,:), allocatable stdlat
 
real, dimension(:), allocatable bdylon
 
real, dimension(:), allocatable bdylat
 
real, dimension(:), allocatable elatbdy
 
real, dimension(:), allocatable elonbdy
 
real, dimension(:), allocatable anglbdy
 
real bpolat
 
real bpolon
 
real, dimension(:,:), allocatable xgrdin
 
real, dimension(:,:), allocatable ygrdin
 
real, dimension(:,:), allocatable zbin
 
real, dimension(:,:), allocatable obsx
 
real, dimension(:,:), allocatable obsy
 
real, dimension(:,:), allocatable refd
 
real, dimension(:,:), allocatable refd2
 
real, dimension(:,:), allocatable refs
 
real, dimension(:,:), allocatable sed_d50file
 
real, dimension(:,:), allocatable sed_porofile
 
logical sedmapd50
 
real sed_d50_uniform
 
real sed_dstar
 
real ripfac1
 
real ripfac2
 
real ripfac3
 
real ripfac4
 
real sigdepth
 
real botroughmin
 
real botroughfac
 
logical fllin
 
logical flinds
 
logical flnl
 
logical flbt
 
logical fldb
 
logical fltr
 
logical flbs
 
logical flprop
 
logical flref
 
logical first
 
logical connct
 
logical flnew
 
logical ingrid
 
logical flic
 
logical flis
 
logical flgnml
 
logical fltc96 = .FALSE.
 
logical flnmlo = .FALSE.
 
logical flstb2 = .FALSE.
 
logical flst4 = .FALSE.
 
logical flst6 = .FALSE.
 
real facberg
 
real refslope
 
real isc1
 
real isc2
 
real is2backscat
 
real is2c2
 
real is2c3
 
real is2fragility
 
real is2dmin
 
real is2damp
 
real is2conc
 
real is2creepb
 
real is2creepc
 
real is2creepd
 
real is2creepn
 
real is2breake
 
real is2wim1
 
real is2breakf
 
real is2flexstr
 
real is2andisn
 
real is2andise
 
real is2andisd
 
logical is2break
 
logical is2disp
 
logical is2dupdate
 
logical is2isoscat
 
logical is2andisb
 
real refcoast
 
real reffreq
 
real refmap
 
real refsubgrid
 
real refrmax
 
real refmapd
 
real reficeberg
 
real refcosp_straight
 
real reffreqpow
 
real refunstsource
 
logical igswellmax
 
logical igbcoverwrite
 
integer igmethod
 
integer igaddoutp
 
integer igsource
 
integer igsourceatbp
 
integer igsterms
 
real igmaxfreq
 
real igmindep
 
real igmaxdep
 
real igkdmin
 
real igfixeddepth
 
real igempirical
 
logical ic2disper
 
real ic2turb
 
real ic2rough
 
real ic2reynolds
 
real ic2smooth
 
real ic2visc
 
real ic2turbs
 
real ic2dmax
 
real ic3maxthk
 
real ic3maxcnc
 
real ic3hilim
 
real ic3kilim
 
real ic3visc
 
real ic3elas
 
real ic3dens
 
real ic3hice
 
logical ic3cheng
 
logical usecgice
 
integer ic4method
 
real, dimension(nic4) ic4ki
 
real, dimension(nic4) ic4fc
 
real, dimension(nic42) ic4cn
 
real ic4fmin
 
real ic4kibk
 
real ic5minig
 
real ic5minwt
 
real ic5maxkratio
 
real ic5maxki
 
real ic5minhw
 
real ic5maxiter
 
real ic5rkick
 
real ic5kfilter
 
real ic5vemod
 
character(len=4), dimension(3) ic5mstr = (/' EFS', ' RP ', ' M2 '/)
 
character comstr
 
character pname
 
character rform
 
character from
 
character fname
 
character tname
 
character line
 
character status
 
character fname2
 
character pname2
 
character(len=6), dimension(2) yesxno
 
character(len=18) typeid
 
integer ncid
 
integer grid_size_dimid
 
integer grid_rank_dimid
 
integer grid_corners_dimid
 
integer grid_center_lat_varid
 
integer grid_center_lon_varid
 
integer grid_corner_lat_varid
 
integer grid_corner_lon_varid
 
integer grid_area_varid
 
integer grid_imask_varid
 
integer grid_dims_varid
 
real(scrip_r8) conv_dx
 
real(scrip_r8) conv_dy
 
real(scrip_r8) offset
 
integer flagtr
 
integer ihm
 
real cfltm
 
real cice0
 
real cicen
 
real pmove
 
real xfilt
 
real lice
 
real xseed
 
real xr
 
real hspm
 
real wsm
 
real wsc
 
real stdx
 
real stdy
 
real stdt
 
real icehmin
 
real icehfac
 
real icehinit
 
real icesln
 
real icewind
 
real icesnl
 
real icesds
 
real icehdisp
 
real icefdisp
 
real iceddisp
 
real btbet
 
real(8) gshift
 
logical flc
 
logical icedisp
 
logical trckcmpr
 
integer ptm
 
real ptfc
 
real aircmin
 
real airgb
 
character pmname
 
character pmnam2
 
integer tailtype
 
real taillev
 
real tailt1
 
real tailt2
 
integer ctype
 
real cdmax
 
real cdfac
 
real zwnd
 
real swellf
 
real stabsh
 
real stabof
 
real cneg
 
real cpos
 
real fneg
 
real fpos
 
real sdsa0
 
real sdsa1
 
real sdsa2
 
real sdsb0
 
real sdsb1
 
real sdsb2
 
real sdsb3
 
real alpha0
 
real z0max
 
real betamax
 
real sinthp
 
real zalp
 
real fxpm3
 
real fxfm3
 
real wnmeanptail
 
real wnmeanp
 
real stxftf
 
real stxftwn
 
real stxftftail
 
real sdsc1
 
real sdsdelta1
 
real sdsdelta2
 
integer swellfpar
 
integer sdsiso
 
integer sdsbrfdf
 
integer sintable
 
integer tauwbug
 
real sdsbchoice
 
real z0rat
 
real tauwshelter
 
real swellf2
 
real swellf3
 
real swellf4
 
real swellf5
 
real swellf6
 
real swellf7
 
real sinbr
 
real fxfmage
 
real sdsc2
 
real sdscum
 
real sdsc4
 
real sdsc5
 
real sdsc6
 
real whitecapwidth
 
real whitecapdur
 
real sdsstrain
 
real sdsstraina
 
real sdsstrain2
 
real sdsbr
 
real sdsp
 
real sdsbt
 
real sds4a
 
real sdkof
 
real sdscos
 
real sdsdth
 
real sdsbck
 
real sdsabk
 
real sdspbk
 
real sdsbint
 
real sdshck
 
real sdsbrf1
 
real sdsbm0
 
real sdsbm1
 
real sdsbm2
 
real sdsbm3
 
real sdsbm4
 
real sdsfacmtf
 
real sdscump
 
real sdsnuw
 
real sdsl
 
real sdsmwd
 
real sdsmwpow
 
real spmss
 
real sdsnmtf
 
real sintail1
 
real sintail2
 
real cumsigp
 
real viscstress
 
real capcha
 
real chamin
 
real cha0
 
real ucap
 
real sigmaucap
 
real sina0
 
real sinws
 
real sinfc
 
real swlb1
 
integer sdsp1
 
integer sdsp2
 
logical sdset
 
logical cstb1
 
real lambda
 
real kdconv
 
real kdmin
 
real snlcs1
 
real snlcs2
 
real snlcs3
 
integer iqtype
 
integer gqmnf1
 
integer gqmnt1
 
integer gqmnq_om2
 
real tailnl
 
real gqmthrsat
 
real gqmthrcou
 
real gqamp1
 
real gqamp2
 
real gqamp3
 
real gqamp4
 
integer ndepth
 
integer nqdef
 
real msc
 
real nsc
 
real kdfd
 
real kdfs
 
integer indtsa
 
integer altlp
 
real nl5dpt
 
real nl5oml
 
integer nl5dis
 
integer nl5kev
 
integer nl5ipl
 
integer nl5pmx
 
real bjalfa
 
real bjgam
 
logical bjflag
 
real dtime
 
real dtims
 
real cflsm
 
real rfmaxd
 
real symr
 
real yj0r
 
logical uno3
 
logical averg
 
logical seawnd
 
logical arctic
 
character pnsmc
 
real wdthcg
 
real wdthth
 
logical jgs_terminate_maxiter
 
logical jgs_terminate_difference
 
logical jgs_terminate_norm
 
logical jgs_limiter
 
integer jgs_limiter_func
 
logical jgs_block_gauss_seidel
 
logical jgs_use_jacobi
 
logical jgs_source_nonlinear
 
logical ugobcauto
 
logical ugbccfl
 
logical expfsn
 
logical expfspsi
 
logical expfsfct
 
logical impfsn
 
logical exptotal
 
logical imptotal
 
logical imprefraction
 
logical impfreqshift
 
logical impsource
 
logical setup_apply_wlv
 
integer jgs_maxiter
 
integer nbsel
 
integer, dimension(6) unstschemes
 
integer unstscheme
 
integer jgs_nlevel
 
real *8 jgs_pmin
 
real *8 jgs_diff_thr
 
real *8 jgs_norm_thr
 
real *8 solverthr_setup
 
real *8 crit_dep_setup
 
character ugobcfile
 
real ugobcdepth
 
logical ugobcok
 
real plat
 
real plon
 
logical unrot
 
real, dimension(9) bplat
 
real, dimension(9) bplon
 

Function/Subroutine Documentation

◆ readnl()

subroutine w3gridmd::readnl ( integer, intent(in)  NDS,
character, intent(in)  NAME,
character, intent(out)  STATUS 
)

Definition at line 7199 of file w3gridmd.F90.

7199  !/
7200  !/ +-----------------------------------+
7201  !/ | WAVEWATCH III NOAA/NCEP |
7202  !/ | H. L. Tolman |
7203  !/ | FORTRAN 90 |
7204  !/ | Last update : 01-Jun-2013 |
7205  !/ +-----------------------------------+
7206  !/
7207  ! 1. Purpose :
7208  !
7209  ! Read namelist info from file if namelist is found in file.
7210  !
7211  ! 2. Method :
7212  !
7213  ! Look for namelist with name NAME in unit NDS and read if found.
7214  !
7215  ! 3. Parameters :
7216  !
7217  ! Parameter list
7218  ! ----------------------------------------------------------------
7219  ! NDS Int. I Data set number used for search.
7220  ! NAME C*4 I Name of namelist.
7221  ! STATUS C*20 O Status at end of routine,
7222  ! '(default values) ' if no namelist found.
7223  ! '(user def. values)' if namelist read.
7224  ! ----------------------------------------------------------------
7225  !
7226  ! 4. Subroutines used :
7227  !
7228  ! Name Type Module Description
7229  ! ----------------------------------------------------------------
7230  ! EXTCDE Subr. W3SERVMD Abort program as graceful as possible.
7231  ! ----------------------------------------------------------------
7232  !
7233  ! 5. Called by :
7234  !
7235  ! Program in which it is contained.
7236  !
7237  ! 6. Error messages :
7238  !
7239  ! 7. Remarks :
7240  !
7241  ! 8. Structure :
7242  !
7243  ! 9. Switches :
7244  !
7245  ! 10. Source code :
7246  !
7247  !/ ------------------------------------------------------------------- /
7248  !/ Parameter list
7249  !/
7250  INTEGER, INTENT(IN) :: NDS
7251  CHARACTER, INTENT(IN) :: NAME*4
7252  CHARACTER, INTENT(OUT) :: STATUS*20
7253  !/
7254  !/ ------------------------------------------------------------------- /
7255  !/ Local parameters
7256  !/
7257  INTEGER :: IERR, I, J
7258  CHARACTER :: LINE*80
7259  !/
7260  !/ ------------------------------------------------------------------- /
7261  !/
7262 #ifdef W3_S
7263  CALL strace (ient, 'READNL')
7264 #endif
7265  !
7266  rewind(nds)
7267  status = '(default values) : '
7268  !
7269  DO
7270  READ (nds,'(A)',END=800,ERR=800,IOSTAT=IERR) line
7271  DO i=1, 70
7272  IF ( line(i:i) .NE. ' ' ) THEN
7273  IF ( line(i:i) .EQ. '&' ) THEN
7274  IF ( line(i+1:i+4) .EQ. name ) THEN
7275  backspace(nds)
7276  SELECT CASE(name)
7277 #ifdef W3_FLD1
7278  CASE('FLD1')
7279  READ (nds,nml=fld1,END=801,ERR=802,IOSTAT=J)
7280 #endif
7281 #ifdef W3_FLD2
7282  CASE('FLD2')
7283  READ (nds,nml=fld2,END=801,ERR=802,IOSTAT=J)
7284 #endif
7285 #ifdef W3_FLX3
7286  CASE('FLX3')
7287  READ (nds,nml=flx3,END=801,ERR=802,IOSTAT=J)
7288 #endif
7289 #ifdef W3_FLX4
7290  CASE('FLX4')
7291  READ (nds,nml=flx4,END=801,ERR=802,IOSTAT=J)
7292 #endif
7293 #ifdef W3_LN1
7294  CASE('SLN1')
7295  READ (nds,nml=sln1,END=801,ERR=802,IOSTAT=J)
7296 #endif
7297 #ifdef W3_ST1
7298  CASE('SIN1')
7299  READ (nds,nml=sin1,END=801,ERR=802,IOSTAT=J)
7300 #endif
7301 #ifdef W3_ST2
7302  CASE('SIN2')
7303  READ (nds,nml=sin2,END=801,ERR=802,IOSTAT=J)
7304 #endif
7305 #ifdef W3_ST3
7306  CASE('SIN3')
7307  READ (nds,nml=sin3,END=801,ERR=802,IOSTAT=J)
7308 #endif
7309 #ifdef W3_ST4
7310  CASE('SIN4')
7311  READ (nds,nml=sin4,END=801,ERR=802,IOSTAT=J)
7312 #endif
7313 #ifdef W3_ST6
7314  CASE('SIN6')
7315  READ (nds,nml=sin6,END=801,ERR=802,IOSTAT=J)
7316 #endif
7317 #ifdef W3_NL1
7318  CASE('SNL1')
7319  READ (nds,nml=snl1,END=801,ERR=802,IOSTAT=J)
7320 #endif
7321 #ifdef W3_NL2
7322  CASE('SNL2')
7323  READ (nds,nml=snl2,END=801,ERR=802,IOSTAT=J)
7324  CASE('ANL2')
7325  IF ( ndepth .GT. 100 ) GOTO 804
7326  depths(1:ndepth) = dpthnl
7327  READ (nds,nml=anl2,END=801,ERR=802,IOSTAT=J)
7328  dpthnl = depths(1:ndepth)
7329 #endif
7330 #ifdef W3_NL3
7331  CASE('SNL3')
7332  READ (nds,nml=snl3,END=801,ERR=802,IOSTAT=J)
7333  CASE('ANL3')
7334  IF ( nqdef .GT. 100 ) GOTO 804
7335  READ (nds,nml=anl3,END=801,ERR=802,IOSTAT=J)
7336 #endif
7337 #ifdef W3_NL4
7338  CASE('SNL4')
7339  READ (nds,nml=snl4,END=801,ERR=802,IOSTAT=J)
7340 #endif
7341 #ifdef W3_NL5
7342  CASE('SNL5')
7343  READ (nds,nml=snl5,END=801,ERR=802,IOSTAT=J)
7344 #endif
7345 #ifdef W3_NLS
7346  CASE('SNLS')
7347  READ (nds,nml=snls,END=801,ERR=802,IOSTAT=J)
7348 #endif
7349 #ifdef W3_ST1
7350  CASE('SDS1')
7351  READ (nds,nml=sds1,END=801,ERR=802,IOSTAT=J)
7352 #endif
7353 #ifdef W3_ST2
7354  CASE('SDS2')
7355  READ (nds,nml=sds2,END=801,ERR=802,IOSTAT=J)
7356 #endif
7357 #ifdef W3_ST3
7358  CASE('SDS3')
7359  READ (nds,nml=sds3,END=801,ERR=802,IOSTAT=J)
7360 #endif
7361 #ifdef W3_ST4
7362  CASE('SDS4')
7363  READ (nds,nml=sds4,END=801,ERR=802,IOSTAT=J)
7364 #endif
7365 #ifdef W3_ST6
7366  CASE('SDS6')
7367  READ (nds,nml=sds6,END=801,ERR=802,IOSTAT=J)
7368  CASE('SWL6')
7369  READ (nds,nml=swl6,END=801,ERR=802,IOSTAT=J)
7370 #endif
7371 #ifdef W3_BT1
7372  CASE('SBT1')
7373  READ (nds,nml=sbt1,END=801,ERR=802,IOSTAT=J)
7374 #endif
7375 #ifdef W3_BT4
7376  CASE('SBT4')
7377  READ (nds,nml=sbt4,END=801,ERR=802,IOSTAT=J)
7378 #endif
7379 #ifdef W3_IS1
7380  CASE('SIS1')
7381  READ (nds,nml=sis1,END=801,ERR=802,IOSTAT=J)
7382 #endif
7383 #ifdef W3_IS2
7384  CASE('SIS2')
7385  READ (nds,nml=sis2,END=801,ERR=802,IOSTAT=J)
7386 #endif
7387 #ifdef W3_DB1
7388  CASE('SDB1')
7389  READ (nds,nml=sdb1,END=801,ERR=802,IOSTAT=J)
7390 #endif
7391 #ifdef W3_UOST
7392  CASE('UOST')
7393  READ (nds,nml=uost,END=801,ERR=802,IOSTAT=J)
7394 #endif
7395 #ifdef W3_PR1
7396  CASE('PRO1')
7397  READ (nds,nml=pro1,END=801,ERR=802,IOSTAT=J)
7398 #endif
7399 #ifdef W3_PR2
7400  CASE('PRO2')
7401  READ (nds,nml=pro2,END=801,ERR=802,IOSTAT=J)
7402 #endif
7403 #ifdef W3_SMC
7404  CASE('PSMC')
7405  READ (nds,nml=psmc,END=801,ERR=802,IOSTAT=J)
7406 #endif
7407 #ifdef W3_PR3
7408  CASE('PRO3')
7409  READ (nds,nml=pro3,END=801,ERR=802,IOSTAT=J)
7410 #endif
7411 #ifdef W3_RTD
7412  CASE('ROTD')
7413  READ (nds,nml=rotd,END=801,ERR=802,IOSTAT=J)
7414  CASE('ROTB')
7415  READ (nds,nml=rotb,END=801,ERR=802,IOSTAT=J)
7416 #endif
7417 #ifdef W3_REF1
7418  CASE('REF1')
7419  READ (nds,nml=ref1,END=801,ERR=802,IOSTAT=J)
7420 #endif
7421 #ifdef W3_IG1
7422  CASE('SIG1')
7423  READ (nds,nml=sig1,END=801,ERR=802,IOSTAT=J)
7424 #endif
7425 #ifdef W3_IC2
7426  CASE('SIC2')
7427  READ (nds,nml=sic2,END=801,ERR=802,IOSTAT=J)
7428 #endif
7429 #ifdef W3_IC3
7430  CASE('SIC3')
7431  READ (nds,nml=sic3,END=801,ERR=802,IOSTAT=J)
7432 #endif
7433 #ifdef W3_IC4
7434  CASE('SIC4 ')
7435  READ (nds,nml=sic4,END=801,ERR=802,IOSTAT=J)
7436 #endif
7437 #ifdef W3_IC5
7438  CASE('SIC5 ')
7439  READ (nds,nml=sic5,END=801,ERR=802,IOSTAT=J)
7440 #endif
7441  CASE('UNST')
7442  READ (nds,nml=unst,END=801,ERR=802,IOSTAT=J)
7443  CASE('OUTS')
7444  READ (nds,nml=outs,END=801,ERR=802,IOSTAT=J)
7445  CASE('MISC')
7446  READ (nds,nml=misc,END=801,ERR=802,IOSTAT=J)
7447  CASE DEFAULT
7448  GOTO 803
7449  END SELECT
7450  status = '(user def. values) :'
7451  RETURN
7452  END IF
7453  ELSE
7454  EXIT
7455  END IF
7456  ENDIF
7457  END DO
7458  END DO
7459  !
7460 800 CONTINUE
7461  RETURN
7462  !
7463 801 CONTINUE
7464  WRITE (ndse,1001) name
7465  CALL extcde(1)
7466  RETURN
7467  !
7468 802 CONTINUE
7469  WRITE (ndse,1002) name, j
7470  CALL extcde(2)
7471  RETURN
7472  !
7473 803 CONTINUE
7474  WRITE (ndse,1003) name
7475  CALL extcde(3)
7476  RETURN
7477  !
7478 #ifdef W3_NL2
7479 804 CONTINUE
7480  WRITE (ndse,1004) ndepth
7481  CALL extcde(4)
7482  RETURN
7483 #endif
7484  !
7485 #ifdef W3_NL3
7486 804 CONTINUE
7487  WRITE (ndse,1004) nqdef
7488  CALL extcde(4)
7489  RETURN
7490 #endif
7491  !
7492  ! Formats
7493  !
7494 1001 FORMAT (/' *** WAVEWATCH III ERROR IN READNL : '/ &
7495  ' PREMATURE END OF FILE IN READING ',a/)
7496 1002 FORMAT (/' *** WAVEWATCH III ERROR IN READNL : '/ &
7497  ' ERROR IN READING ',a,' IOSTAT =',i8/)
7498 1003 FORMAT (/' *** WAVEWATCH III ERROR IN READNL : '/ &
7499  ' NAMELIST NAME ',a,' NOT RECOGNIZED'/)
7500 #ifdef W3_NL2
7501 1004 FORMAT (/' *** WAVEWATCH III ERROR IN READNL : '/ &
7502  .LE.' TEMP DEPTH ARRAY TOO SMALL, ',i8/)
7503 #endif
7504 #ifdef W3_NL3
7505 1004 FORMAT (/' *** WAVEWATCH-III ERROR IN READNL : '/ &
7506  .LE.' TEMP QPARMS ARRAY TOO SMALL, ',i8/)
7507 #endif
7508  !/
7509  !/ End of READNL ----------------------------------------------------- /
7510  !/

References depths, i, ient, j, line, ndepth, nqdef, and status.

Referenced by w3grid().

◆ w3grid()

subroutine w3gridmd::w3grid

Definition at line 1156 of file w3gridmd.F90.

1156 
1157 #ifdef W3_O0
1158  flnmlo = .true.
1159 #endif
1160 #ifdef W3_STAB2
1161  flstb2 = .true.
1162 #endif
1163  !
1164  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1165  ! 1. Set up grid storage structure
1166  !
1167  CALL w3nmod ( 1, 6, 6 )
1168  CALL w3setg ( 1, 6, 6 )
1169  CALL w3nout ( 6, 6 )
1170  CALL w3seto ( 1, 6, 6 )
1171  !
1172  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1173  ! 2. IO set-up.
1174  !
1175  ndsi = 10
1176  ndss = 99
1177  ndsm = 20
1178  !
1179  INQUIRE(file=trim(fnmpre)//"ww3_grid.nml", exist=flgnml)
1180  IF (flgnml) THEN
1181  ! Read namelist
1182  CALL w3nmlgrid (ndsi, trim(fnmpre)//'ww3_grid.nml', nml_spectrum, nml_run, &
1183  nml_timesteps, nml_grid, nml_rect, nml_curv, &
1184  nml_unst, nml_smc, nml_depth, nml_mask, &
1185  nml_obst, nml_slope, nml_sed, nml_inbnd_count, &
1186  nml_inbnd_point, nml_excl_count, &
1187  nml_excl_point, nml_excl_body, &
1188  nml_outbnd_count, nml_outbnd_line, ierr)
1189  ELSE
1190  OPEN (ndsi,file=trim(fnmpre)//'ww3_grid.inp',status='OLD', &
1191  err=2000,iostat=ierr)
1192  END IF
1193  !
1194  ndstrc = 6
1195  ntrace = 10
1196  CALL itrace ( ndstrc, ntrace )
1197  !
1198 #ifdef W3_S
1199  CALL strace (ient, 'W3GRID')
1200 #endif
1201  WRITE (ndso,900)
1202  !
1203  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1204  ! 3.a Interpolation table for dispersion relation.
1205  !
1206  CALL distab
1207  !
1208  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1209  ! 3.b Table for friction factors
1210  !
1211  CALL tabu_fw
1212  !
1213  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1214  ! 4 Read and process input file up to spectrum
1215  !
1216 
1217  IF (flgnml) THEN
1218  ! grid name
1219  gname=trim(nml_grid%NAME)
1220  WRITE (ndso,902) gname
1221 
1222  ! spectrum parameters
1223  rxfr=nml_spectrum%XFR
1224  rfr1=nml_spectrum%FREQ1
1225  nki=nml_spectrum%NK
1226  nthi=nml_spectrum%NTH
1227  rth0=nml_spectrum%THOFF
1228 
1229  ELSE
1230 
1231  READ (ndsi,'(A)',END=2001,ERR=2002,IOSTAT=IERR) comstr
1232  IF (comstr.EQ.' ') comstr = '$'
1233  WRITE (ndso,901) comstr
1234  CALL nextln ( comstr , ndsi , ndse )
1235  !
1236  CALL nextln ( comstr , ndsi , ndse )
1237  READ (ndsi,*,END=2001,ERR=2002) gname
1238  WRITE (ndso,902) gname
1239  !
1240  CALL nextln ( comstr , ndsi , ndse )
1241  READ (ndsi,*,END=2001,ERR=2002) RXFR, RFR1, NKI, NTHI, rth0
1242  END IF
1243 
1244 
1245  nk = nki
1246  nk2 = nki + 2
1247  nth = nthi
1248  nspec = nk * nth
1249  xfr = max( rxfr , 1.00001 )
1250  fr1 = max( rfr1 , 1.e-6 )
1251  dth = tpi / real(nth)
1252  rth0 = max( -0.5 , min( 0.5 , rth0 ) )
1253  WRITE (ndso,903) nth, dth*rade
1254  WRITE (ndso,904) 360./real(nth)*rth0
1255  WRITE (ndso,905) nk, fr1, fr1*xfr**(nk-1), xfr
1256  !
1257  CALL w3dims ( 1, nk, nth, ndse, ndst )
1258  !
1259  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1260  ! 5. Initialize spectral parameters.
1261  ! 5.a Directions :
1262  !
1263  DO ith=1, nth
1264  th(ith) = dth * ( rth0 + real(ith-1) )
1265  esin(ith) = sin( th(ith) )
1266  ecos(ith) = cos( th(ith) )
1267  IF ( abs(esin(ith)) .LT. 1.e-5 ) THEN
1268  esin(ith) = 0.
1269  IF ( ecos(ith) .GT. 0.5 ) THEN
1270  ecos(ith) = 1.
1271  ELSE
1272  ecos(ith) = -1.
1273  END IF
1274  END IF
1275  IF ( abs(ecos(ith)) .LT. 1.e-5 ) THEN
1276  ecos(ith) = 0.
1277  IF ( esin(ith) .GT. 0.5 ) THEN
1278  esin(ith) = 1.
1279  ELSE
1280  esin(ith) = -1.
1281  END IF
1282  END IF
1283  es2(ith) = esin(ith)**2
1284  ec2(ith) = ecos(ith)**2
1285  esc(ith) = esin(ith)*ecos(ith)
1286  END DO
1287  !
1288  DO ik=2, nk+1
1289  ith0 = (ik-1)*nth
1290  DO ith=1, nth
1291  esin(ith0+ith) = esin(ith)
1292  ecos(ith0+ith) = ecos(ith)
1293  es2(ith0+ith) = es2(ith)
1294  ec2(ith0+ith) = ec2(ith)
1295  esc(ith0+ith) = esc(ith)
1296  END DO
1297  END DO
1298  !
1299  ! b Frequencies :
1300  !
1301  sigma = fr1 * tpi / xfr**2
1302  sxfr = 0.5 * (xfr-1./xfr)
1303  !
1304  DO ik=0, nk+1
1305  sigma = sigma * xfr
1306  sig(ik) = sigma
1307  dsip(ik) = sigma * sxfr
1308  END DO
1309  !
1310  dsii( 1) = 0.5 * sig( 1) * (xfr-1.)
1311  DO ik=2, nk-1
1312  dsii(ik) = dsip(ik)
1313  END DO
1314  dsii(nk) = 0.5 * sig(nk) * (xfr-1.) / xfr
1315  !
1316  DO ik=1, nk
1317  dden(ik) = dth * dsii(ik) * sig(ik)
1318  END DO
1319  !
1320  DO isp=1, nspec
1321  ik = 1 + (isp-1)/nth
1322  sig2(isp) = sig(ik)
1323  dden2(isp) = dden(ik)
1324  END DO
1325  !
1326  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1327  ! 6 Read and process input file up to numerical parameters
1328  ! 6.a Set model flags and time steps
1329  !
1330  WRITE (ndso,910)
1331  IF (flgnml) THEN
1332  fldry=nml_run%FLDRY
1333  flcx=nml_run%FLCX
1334  flcy=nml_run%FLCY
1335  flcth=nml_run%FLCTH
1336  flck=nml_run%FLCK
1337  flsou=nml_run%FLSOU
1338  ELSE
1339  CALL nextln ( comstr , ndsi , ndse )
1340  READ (ndsi,*,END=2001,ERR=2002) &
1341  fldry, flcx, flcy, flcth, flck, flsou
1342  END IF
1343  !
1344  iyn = 2
1345  IF ( fldry ) iyn(1) = 1
1346  IF ( flcx ) iyn(2) = 1
1347  IF ( flcy ) iyn(3) = 1
1348  IF ( flcth ) iyn(4) = 1
1349  IF ( flck ) iyn(5) = 1
1350  IF ( flsou ) iyn(6) = 1
1351  !
1352  WRITE (ndso,911) (yesxno(iyn(ifl)),ifl=1,nfl)
1353  !
1354  IF ( .NOT. (fldry.OR.flcx.OR.flcy.OR.flck.OR.flcth.OR.flsou) ) THEN
1355  WRITE (ndse,1010)
1356  CALL extcde ( 2 )
1357  END IF
1358  !
1359  IF (flgnml) THEN
1360  dtmax=nml_timesteps%DTMAX
1361  dtcfl=nml_timesteps%DTXY
1362  dtcfli=nml_timesteps%DTKTH
1363  dtmin=nml_timesteps%DTMIN
1364  ELSE
1365  CALL nextln ( comstr , ndsi , ndse )
1366  READ (ndsi,*,END=2001,ERR=2002) DTMAX, DTCFL, DTCFLI, dtmin
1367  END IF
1368 #ifdef W3_SEC1
1369  IF (dtmax.LT.1.) THEN
1370  nitersec1=ceiling(1./dtmax)
1371  WRITE (ndso,913) nitersec1
1372  ELSE
1373  nitersec1=1
1374  END IF
1375 #endif
1376 
1377  dtmax = max( 1. , dtmax )
1378  !
1379  ! Commented to allow very high resolution zooms
1380  !
1381  ! DTCFL = MAX ( 1. , DTCFL )
1382  ! DTCFLI = MIN ( DTMAX , MAX ( 1. , DTCFLI ) )
1383  dtmin = min( dtmax , max( 0. , dtmin ) )
1384  WRITE (ndso,912) dtmax, dtcfl, dtcfli, dtmin
1385  !
1386  ! 6.b Set / select source term package
1387  !
1388  nrlin = 0
1389  nrsrce = 0
1390  nrnl = 0
1391  nrbt = 0
1392  nric = 0
1393  nris = 0
1394  nrdb = 0
1395  nrtr = 0
1396  nrbs = 0
1397  !
1398  fllin = .true.
1399  flinds = .true.
1400  flnl = .true.
1401  flbt = .true.
1402  flic = .false.
1403  flis = .false.
1404  fldb = .true.
1405  fltr = .true.
1406  flbs = .true.
1407  flref = .false.
1408  !
1409 #ifdef W3_LN0
1410  nrlin = nrlin + 1
1411  fllin = .false.
1412 #endif
1413 #ifdef W3_SEED
1414  nrlin = nrlin + 1
1415 #endif
1416 #ifdef W3_LN1
1417  nrlin = nrlin + 1
1418 #endif
1419  !
1420 #ifdef W3_ST0
1421  nrsrce = nrsrce + 1
1422  flinds = .false.
1423 #endif
1424 #ifdef W3_ST1
1425  nrsrce = nrsrce + 1
1426 #endif
1427 #ifdef W3_ST2
1428  nrsrce = nrsrce + 1
1429  fltc96 = .true.
1430 #endif
1431 #ifdef W3_ST3
1432  nrsrce = nrsrce + 1
1433 #endif
1434 #ifdef W3_ST4
1435  nrsrce = nrsrce + 1
1436  flst4 = .true.
1437 #endif
1438 #ifdef W3_ST6
1439  nrsrce = nrsrce + 1
1440  flst6 = .true.
1441 #endif
1442  !
1443 #ifdef W3_NL0
1444  nrnl = nrnl + 1
1445  flnl = .false.
1446 #endif
1447 #ifdef W3_NL1
1448  nrnl = nrnl + 1
1449 #endif
1450 #ifdef W3_NL2
1451  nrnl = nrnl + 1
1452 #endif
1453 #ifdef W3_NL3
1454  nrnl = nrnl + 1
1455 #endif
1456 #ifdef W3_NL4
1457  nrnl = nrnl + 1
1458 #endif
1459 #ifdef W3_NL5
1460  nrnl = nrnl + 1
1461 #endif
1462  !
1463 #ifdef W3_BT0
1464  nrbt = nrbt + 1
1465  flbt = .false.
1466 #endif
1467 #ifdef W3_BT1
1468  nrbt = nrbt + 1
1469 #endif
1470 #ifdef W3_BT4
1471  nrbt = nrbt + 1
1472 #endif
1473 #ifdef W3_BT8
1474  nrbt = nrbt + 1
1475 #endif
1476 #ifdef W3_BT9
1477  nrbt = nrbt + 1
1478 #endif
1479  !
1480 #ifdef W3_IC1
1481  nric = nric + 1
1482  flic = .true.
1483 #endif
1484 #ifdef W3_IC2
1485  nric = nric + 1
1486  flic = .true.
1487 #endif
1488 #ifdef W3_IC3
1489  nric = nric + 1
1490  flic = .true.
1491 #endif
1492 #ifdef W3_IC4
1493  nric = nric + 1
1494  flic = .true.
1495 #endif
1496 #ifdef W3_IC5
1497  nric = nric + 1
1498  flic = .true.
1499 #endif
1500  !
1501 #ifdef W3_IS1
1502  nris = nris + 1
1503  flis = .true.
1504 #endif
1505 #ifdef W3_IS2
1506  nris = nris + 1
1507  flis = .true.
1508 #endif
1509  !
1510 #ifdef W3_DB0
1511  nrdb = nrdb + 1
1512  fldb = .false.
1513 #endif
1514 #ifdef W3_DB1
1515  nrdb = nrdb + 1
1516 #endif
1517  !
1518 #ifdef W3_TR0
1519  nrtr = nrtr + 1
1520  fltr = .false.
1521 #endif
1522 #ifdef W3_TR1
1523  nrtr = nrtr + 1
1524 #endif
1525  !
1526 #ifdef W3_BS0
1527  nrbs = nrbs + 1
1528  flbs = .false.
1529 #endif
1530 #ifdef W3_BS1
1531  nrbs = nrbs + 1
1532 #endif
1533  !
1534 #ifdef W3_REF1
1535  flref = .true.
1536 #endif
1537  !
1538  IF ( .NOT.fllin .AND. .NOT.flinds .AND. .NOT.flnl .AND. &
1539  .NOT.flbt .AND. .NOT.flic .AND. .NOT.flis .AND. &
1540  .NOT.fldb .AND. .NOT.fltr .AND. .NOT.flbs .AND. &
1541  .NOT.flref .AND. flsou ) THEN
1542  WRITE (ndse,1020)
1543  CALL extcde ( 10 )
1544  END IF
1545  !
1546  IF ( ( fllin .OR. flinds .OR. flnl .OR. flbt .OR. fldb .OR. &
1547  fltr .OR. flbs .OR. flref .OR. flic ) &
1548  .AND. .NOT.flsou ) THEN
1549  WRITE (ndse,1021)
1550  END IF
1551  !
1552  IF ( nrlin .NE. 1 ) THEN
1553  WRITE (ndse,1022) nrlin
1554  CALL extcde ( 11 )
1555  END IF
1556  !
1557  IF ( nrsrce .NE. 1 ) THEN
1558  WRITE (ndse,1023) nrsrce
1559  CALL extcde ( 12 )
1560  END IF
1561  !
1562  IF ( nrnl .NE. 1 ) THEN
1563  WRITE (ndse,1024) nrnl
1564  CALL extcde ( 13 )
1565  END IF
1566  !
1567  IF ( nrbt .NE. 1 ) THEN
1568  WRITE (ndse,1025) nrbt
1569  CALL extcde ( 14 )
1570  END IF
1571  !
1572  IF ( nrdb .NE. 1 ) THEN
1573  WRITE (ndse,1026) nrdb
1574  CALL extcde ( 15 )
1575  END IF
1576  !
1577  IF ( nrtr .NE. 1 ) THEN
1578  WRITE (ndse,1027) nrtr
1579  CALL extcde ( 16 )
1580  END IF
1581  !
1582  IF ( nrbs .NE. 1 ) THEN
1583  WRITE (ndse,1028) nrbs
1584  CALL extcde ( 17 )
1585  END IF
1586  !
1587  IF ( nric .GT. 1 ) THEN
1588  WRITE (ndse,1034) nric
1589  CALL extcde ( 19 )
1590  END IF
1591  !
1592  IF ( nris .GT. 1 ) THEN
1593  WRITE (ndse,1036) nris
1594  CALL extcde ( 26 )
1595  END IF
1596 
1597 
1598  !
1599  ! 6.c Read namelist file or Pre-process namelists into scratch file
1600  !
1601  WRITE (ndso,915)
1602  IF (flgnml) THEN
1603  OPEN (ndss,file=trim(fnmpre)//trim(nml_grid%NML),status='OLD',form='FORMATTED')
1604  ELSE
1605  OPEN (ndss,file=trim(fnmpre)//'ww3_grid.scratch',form='FORMATTED')
1606  DO
1607  CALL nextln ( comstr , ndsi , ndse )
1608  READ (ndsi,'(A)',END=2001,ERR=2002) line
1609  IF ( line(1:16) .EQ. 'END OF NAMELISTS' ) THEN
1610  EXIT
1611  ELSE
1612  WRITE (ndss,'(A)') line
1613  ENDIF
1614  END DO
1615  END IF
1616  WRITE (ndso,916)
1617  !
1618  ! 6.d Define Sin.
1619  ! 6.d.1 Stresses
1620  !
1621 #ifdef W3_FLX1
1622  WRITE (ndso,810)
1623 #endif
1624 #ifdef W3_FLX2
1625  WRITE (ndso,810)
1626  cinxsi = 0.20
1627  nittin = 3
1628 #endif
1629 #ifdef W3_FLX3
1630  cinxsi = 0.20
1631  nittin = 3
1632  cdmax = 2.5e-3
1633  ctype = 0
1634  CALL readnl ( ndss, 'FLX3', status )
1635  WRITE (ndso,810) status
1636  cdmax = max( 0. , cdmax )
1637  IF ( ctype .EQ. 1 ) THEN
1638  typeid = 'hyperbolic tangent'
1639  ELSE
1640  ctype = 0
1641  typeid = 'discontinuous '
1642  END IF
1643  WRITE (ndso,811) cdmax*1.e3, typeid
1644  cd_max = cdmax
1645  cap_id = ctype
1646 #endif
1647  !
1648 #ifdef W3_FLX4
1649  cdfac = 1.0
1650  CALL readnl ( ndss, 'FLX4', status )
1651  WRITE (ndso,810) status
1652  WRITE (ndso,811) cdfac
1653  flx4a0 = cdfac
1654 #endif
1655 #ifdef W3_FLX5
1656  WRITE (ndso,810)
1657 #endif
1658  !
1659  ! 6.d.2 Linear input
1660  !
1661 #ifdef W3_LN0
1662  WRITE (ndso,820)
1663 #endif
1664 #ifdef W3_SEED
1665  WRITE (ndso,820)
1666 #endif
1667  !
1668 #ifdef W3_LN1
1669  clin = 80.
1670  rfpm = 1.
1671  rfhf = 0.5
1672  CALL readnl ( ndss, 'SLN1', status )
1673  WRITE (ndso,820) status
1674  clin = max(0.,clin)
1675  rfpm = max(0.,rfpm)
1676  rfhf = max(0.,min(1.,rfhf))
1677  WRITE (ndso,821) clin, rfpm, rfhf
1678  slnc1 = clin * (dair/dwat)**2 / grav**2
1679  fspm = rfpm
1680  fshf = rfhf
1681 #endif
1682  !
1683  ! 6.d.3 Exponential input
1684  !
1685 #ifdef W3_ST0
1686  WRITE (ndso,920)
1687 #endif
1688  !
1689 #ifdef W3_ST1
1690  cinp = 0.25
1691 #endif
1692 #ifdef W3_ST2
1693  zwnd = 10.
1694  swellf = 0.100
1695  stabsh = 1.38
1696  stabof = -0.01
1697  cneg = -0.1
1698  cpos = 0.1
1699  fneg = 150.
1700 #endif
1701  !
1702 #ifdef W3_ST3
1703  zwnd = 10.
1704  alpha0 = 0.0095
1705  z0max = 0.0
1706  betamax = 1.2 ! default WAM4 / WAM4 + is 1.2 with rhow=1000
1707  sinthp = 2.
1708  swellf = 0.
1709  zalp = 0.0110
1710 #endif
1711  !
1712 #ifdef W3_ST4
1713  zwnd = 10.
1714  alpha0 = 0.0095
1715  z0max = 0.0
1716  z0rat = 0.04
1717  betamax = 1.43
1718  sinthp = 2.
1719  swellf = 0.66
1720  swellfpar = 1
1721  swellf2 = -0.018
1722  swellf3 = 0.022
1723  swellf4 = 1.5e5
1724  swellf5 = 1.2
1725  swellf6 = 0.
1726  swellf7 = 360000.
1727  tauwshelter = 0.3
1728  zalp = 0.006
1729  sinbr = 0.
1730  sintable = 1
1731  sintail1 = 0. ! TAUWSHELTER FOR TAIL (no table)
1732  sintail2 = 0. ! additional peak in capillary range
1733  tauwbug = 1 ! TAUWBUG is 1 is the bug is kept:
1734  ! initializes TAUWX/Y to zero in W3SRCE
1735  viscstress =0
1736  capcha = 0. ! =1 indicates capping of drag is active
1737  chamin = 0.0001 !
1738  cha0 = alpha0 ! initial value for charnock
1739  ucap = 30. ! U10 threshold from which drag capping is applied
1740  sigmaucap = 10. ! Width for reduction of drag beyond UCAP
1741 #endif
1742  !
1743 #ifdef W3_ST6
1744  sina0 = 0.09
1745  sinws = 32.0
1746  sinfc = 6.0
1747 #endif
1748  !
1749 #ifdef W3_ST1
1750  CALL readnl ( ndss, 'SIN1', status )
1751  WRITE (ndso,920) status
1752  WRITE (ndso,921) cinp
1753  sinc1 = 28. * cinp * dair / dwat
1754 #endif
1755  !
1756 #ifdef W3_ST2
1757  CALL readnl ( ndss, 'SIN2', status )
1758  WRITE (ndso,920) status
1759  IF ( swellf.LT.0. .OR. swellf.GT.1. ) swellf = 1.
1760  WRITE (ndso,921) zwnd, swellf
1761  IF ( stabsh .LT. 0.1 ) stabsh = 1.
1762  IF ( cneg*cpos .EQ. 0. ) THEN
1763  cneg = 0.
1764  cpos = 0.
1765  fneg = 0.
1766  fpos = 0.
1767  ELSE
1768  cpos = - abs(cpos) * abs(cneg)/cneg
1769  fneg = - max(1.,abs(fneg))
1770  fpos = fneg * cneg/cpos
1771  END IF
1772 #endif
1773 #ifdef W3_STAB2
1774  WRITE (ndso,1921) stabsh, stabof, cneg, cpos, fneg, fpos
1775 #endif
1776 #ifdef W3_ST2
1777  zwind = zwnd
1778  fswell = swellf
1779  shstab = stabsh
1780  ofstab = stabof
1781  ccng = cneg
1782  ccps = cpos
1783  ffng = fneg
1784  ffps = fpos
1785 #endif
1786  !
1787 #ifdef W3_ST3
1788  CALL readnl ( ndss, 'SIN3', status )
1789  WRITE (ndso,920) status
1790  WRITE (ndso,921) alpha0, betamax, sinthp, z0max, zalp, zwnd, &
1791  swellf
1792  zzwnd = zwnd
1793  aalpha = alpha0
1794  bbeta = betamax
1795  ssinthp = sinthp
1796  zz0max = z0max
1797  zzalp = zalp
1798  sswellf(1) = swellf
1799 #endif
1800  !
1801 #ifdef W3_ST4
1802  CALL readnl ( ndss, 'SIN4', status )
1803  WRITE (ndso,920) status
1804  WRITE (ndso,921) alpha0, betamax, sinthp, z0max, zalp, zwnd, tauwshelter, &
1805  swellfpar, swellf, swellf2, swellf3, swellf4, swellf5, &
1806  swellf6, swellf7, z0rat
1807  zzwnd = zwnd
1808  aalpha = alpha0
1809  bbeta = betamax
1810  ssinbr = sinbr
1811  ssinthp = sinthp
1812  zz0max = z0max
1813  zz0rat = z0rat
1814  zzalp = zalp
1815  ttauwshelter = tauwshelter
1816  sswellf(1) = swellf
1817  sswellf(2) = swellf2
1818  sswellf(3) = swellf3
1819  sswellf(4) = swellf4
1820  sswellf(5) = swellf5
1821  sswellf(6) = swellf6
1822  sswellf(7) = swellf7
1823  sswellfpar = swellfpar
1824  sintailpar(1) = float(sintable)
1825  sintailpar(2) = sintail1
1826  sintailpar(3) = sintail2
1827  sintailpar(4) = float(tauwbug)
1828  sintailpar(5) = viscstress
1829  capchnk(1) = capcha
1830  capchnk(2) = chamin
1831  capchnk(3) = cha0
1832  capchnk(4) = ucap
1833  capchnk(5) = sigmaucap
1834 #endif
1835  !
1836 #ifdef W3_ST6
1837  CALL readnl ( ndss, 'SIN6', status )
1838  WRITE (ndso,920) status
1839  sin6a0 = sina0
1840  sin6ws = sinws
1841  sin6fc = sinfc
1842  j = 1
1843  IF ( sin6a0.LE.0. ) j = 2
1844  WRITE (ndso,921) yesxno(j), sin6a0, sin6ws, sin6fc
1845 #endif
1846  !
1847  ! 6.e Define Snl.
1848  !
1849 #ifdef W3_NL0
1850  WRITE (ndso,922)
1851 #endif
1852  !
1853 #ifdef W3_NL1
1854  lambda = 0.25
1855  IF ( fltc96 ) THEN
1856  nlprop = 1.00e7
1857  ELSE IF ( flst4 ) THEN
1858  nlprop = 2.50e7
1859  ELSE IF ( flst6 ) THEN
1860  nlprop = 3.00e7
1861  ELSE
1862  nlprop = 2.78e7
1863  END IF
1864  kdconv = 0.75
1865  kdmin = 0.50
1866  snlcs1 = 5.5
1867  snlcs2 = 0.833
1868  snlcs3 = -1.25
1869  ! Additional parameters for GQM
1870  iqtype = 1
1871  tailnl = -fachf
1872  gqmnf1 = 14
1873  gqmnt1 = 8
1874  gqmnq_om2=8
1875  gqmthrsat=0.
1876  gqmthrcou=0.015
1877  gqamp1=1.
1878  gqamp2=0.002
1879  gqamp3=1.
1880  gqamp4=1.
1881  CALL readnl ( ndss, 'SNL1', status )
1882  WRITE (ndso,922) status
1883  WRITE (ndso,923) lambda, nlprop, kdconv, kdmin, &
1884  snlcs1, snlcs2, snlcs3
1885  snlc1 = nlprop / grav**4
1886  lam = lambda
1887  kdcon = kdconv
1888  kdmn = kdmin
1889  snls1 = snlcs1
1890  snls2 = snlcs2
1891  snls3 = snlcs3
1892  ! Additional parameters for GQM
1893  iqtpe = iqtype
1894  gqnf1 = gqmnf1
1895  gqnt1 = gqmnt1
1896  gqnq_om2 = gqmnq_om2
1897  gqthrsat = gqmthrsat
1898  gqthrcou = gqmthrcou
1899  gqamp(1) = gqamp1
1900  gqamp(2) = gqamp2
1901  gqamp(3) = gqamp3
1902  gqamp(4) = gqamp4
1903  nltail = tailnl
1904 #endif
1905  !
1906 #ifdef W3_ST0
1907  fachf = 5.
1908 #endif
1909 #ifdef W3_ST1
1910  fachf = 4.5
1911 #endif
1912 #ifdef W3_ST2
1913  fachf = 5.
1914 #endif
1915 #ifdef W3_ST3
1916  fachf = 5.
1917 #endif
1918 #ifdef W3_ST4
1919  fachf = 5.
1920 #endif
1921 #ifdef W3_ST6
1922  fachf = 5.
1923 #endif
1924 #ifdef W3_NL2
1925  iqtype = 2
1926  tailnl = -fachf
1927  ndepth = 0
1928 #endif
1929 #ifdef W3_NL3
1930  nqdef = 0
1931  msc = 0.
1932  nsc = -3.5
1933  kdfd = 0.20
1934  kdfs = 5.00
1935 #endif
1936 #ifdef W3_NL4
1937  indtsa = 1
1938  altlp = 2
1939 #endif
1940 #ifdef W3_NL5
1941  nl5dpt = 3000.
1942  nl5oml = 0.10
1943  nl5dis = 0
1944  nl5kev = 0
1945  nl5ipl = 1
1946  nl5pmx = 100
1947 #endif
1948 #ifdef W3_NLS
1949  a34 = 0.05
1950  fhfc = 1.e10
1951  dnm = 0.25
1952  fc1 = 1.25
1953  fc2 = 1.50
1954  fc3 = 6.00
1955 #endif
1956  !
1957 #ifdef W3_NL2
1958  CALL readnl ( ndss, 'SNL2', status )
1959  WRITE (ndso,922) status
1960  tailnl = min( max( tailnl, -5. ) , -4. )
1961  IF ( iqtype .EQ. 3 ) THEN
1962  WRITE (ndso,923) 'Shallow water', tailnl
1963  ELSE IF ( iqtype .EQ. 2 ) THEN
1964  WRITE (ndso,923) 'Deep water with scaling', tailnl
1965  ELSE
1966  WRITE (ndso,923) 'Deep water', tailnl
1967  iqtype = 1
1968  END IF
1969  !
1970  IF ( iqtype .NE. 3 ) THEN
1971  ndepth = 1
1972  ALLOCATE ( mpars(1)%SNLPS%DPTHNL(ndepth) )
1973  dpthnl => mpars(1)%SNLPS%DPTHNL
1974  dpthnl = 1000.
1975  ELSE
1976  IF ( ndepth .EQ. 0 ) ndepth = 7
1977  ndepth = max( 1 , ndepth )
1978  ALLOCATE ( mpars(1)%SNLPS%DPTHNL(ndepth) )
1979  dpthnl => mpars(1)%SNLPS%DPTHNL
1980  dpthnl(1) = 640.
1981  dpthnl(ndepth) = 10.
1982  IF ( ndepth .GT. 1 ) THEN
1983  dptfac = (dpthnl(ndepth)/dpthnl(1))**(1./(real(ndepth-1)))
1984  DO idepth=2, ndepth-1
1985  dpthnl(idepth) = dptfac*dpthnl(idepth-1)
1986  END DO
1987  END IF
1988  CALL readnl ( ndss, 'ANL2', status )
1989  WRITE (ndso,1923) ndepth, dpthnl(1:min(5,ndepth))
1990  IF (ndepth .GT. 5 )WRITE (ndso,2923) dpthnl(6:ndepth)
1991  END IF
1992  WRITE (ndst,*)
1993  iqtpe = iqtype
1994  ndpths = ndepth
1995  nltail = tailnl
1996 #endif
1997  !
1998 #ifdef W3_NL3
1999  CALL readnl ( ndss, 'SNL3', status )
2000  WRITE (ndso,922) status
2001  kdfd = max( 0.001 , min( 10. , kdfd ) )
2002  kdfs = max( kdfd , min( 10. , kdfs ) )
2003  WRITE (ndso,923) msc, nsc, kdfd, kdfs
2004  !
2005  nqdef = max( 0 , nqdef )
2006  IF ( nqdef .EQ. 0 ) THEN
2007  nqdef = 1
2008  qparms(1:5) = [ 0.25 , 0.00, -1., 1.e7, 0.00 ]
2009  ELSE
2010  DO j=1, nqdef
2011  qparms((j-1)*5+1:j*5) = [ 0.25, 0.00, -1., 1.e7, 1.e6 ]
2012  END DO
2013  CALL readnl ( ndss, 'ANL3', status )
2014  END IF
2015  DO j=1, nqdef
2016  qparms((j-1)*5+1) = max(0.,min(lammax,qparms((j-1)*5+1)))
2017  qparms((j-1)*5+2) = max(0.,min(qparms((j-1)*5+1), &
2018  qparms((j-1)*5+2)))
2019  qparms((j-1)*5+3) = min(delthm,qparms((j-1)*5+3))
2020  qparms((j-1)*5+4) = max(0.,qparms((j-1)*5+4))
2021  qparms((j-1)*5+5) = max(0.,qparms((j-1)*5+5))
2022  END DO
2023  WRITE (ndso,1923) nqdef
2024  WRITE (ndso,2923) qparms(1:nqdef*5)
2025  WRITE (ndso,*)
2026  snlnq = nqdef
2027  snlmsc = msc
2028  snlnsc = nsc
2029  snlsfd = sqrt( kdfd * tanh(kdfd) )
2030  snlsfs = sqrt( kdfs * tanh(kdfs) )
2031  ALLOCATE ( mpars(1)%SNLPS%SNLL(nqdef), &
2032  mpars(1)%SNLPS%SNLM(nqdef), &
2033  mpars(1)%SNLPS%SNLT(nqdef), &
2034  mpars(1)%SNLPS%SNLCD(nqdef), &
2035  mpars(1)%SNLPS%SNLCS(nqdef) )
2036  snll => mpars(1)%SNLPS%SNLL
2037  snll = qparms(1:nqdef*5:5)
2038  snlm => mpars(1)%SNLPS%SNLM
2039  snlm = qparms(2:nqdef*5:5)
2040  snlt => mpars(1)%SNLPS%SNLT
2041  snlt = qparms(3:nqdef*5:5)
2042  snlcd => mpars(1)%SNLPS%SNLCD
2043  snlcd = qparms(4:nqdef*5:5)
2044  snlcs => mpars(1)%SNLPS%SNLCS
2045  snlcs = qparms(5:nqdef*5:5)
2046 #endif
2047  !
2048 #ifdef W3_NL4
2049  CALL readnl ( ndss, 'SNL4', status )
2050  WRITE (ndso,922) status
2051  WRITE (ndso,923) indtsa, altlp
2052  itsa = indtsa
2053  ialt = altlp
2054 #endif
2055  !
2056 #ifdef W3_NL5
2057  CALL readnl ( ndss, 'SNL5', status )
2058  WRITE (ndso,922) status
2059  nl5dpt = max(0., min(nl5dpt, 3000.))
2060  nl5dis = max(0 , min(nl5dis, 1))
2061  nl5kev = max(0 , min(nl5kev, 1))
2062  nl5ipl = max(0 , min(nl5ipl, 1))
2063  IF (nl5dis .EQ. 1) nl5ipl = 0
2064  IF (nl5pmx .GT. 0) nl5pmx = max(10, nl5pmx)
2065  WRITE (ndso,923) nl5dpt, nl5oml, nl5dis, nl5kev, nl5ipl, nl5pmx
2066  qr5dpt = nl5dpt
2067  qr5oml = nl5oml
2068  qi5dis = nl5dis
2069  qi5kev = nl5kev
2070  qi5ipl = nl5ipl
2071  qi5pmx = nl5pmx
2072 #endif
2073  !
2074 #ifdef W3_NLS
2075  CALL readnl ( ndss, 'SNLS', status )
2076  WRITE (ndso,9922) status
2077  a34 = max( 0. , min( a34 , abmax ) )
2078  fhfc = max( 0. , fhfc )
2079  dnm = max( 0., dnm )
2080  WRITE (ndso,9923) a34, (xfr-1.)*a34, fhfc, dnm, fc1, fc2, fc3
2081  cnlsa = a34
2082  cnlsc = fhfc
2083  cnlsfm = dnm
2084  cnlsc1 = fc1
2085  cnlsc2 = fc2
2086  cnlsc3 = fc3
2087 #endif
2088  !
2089  ! 6.f Define Sds.
2090  !
2091 #ifdef W3_ST0
2092  WRITE (ndso,924)
2093 #endif
2094  !
2095 #ifdef W3_ST1
2096  cdis = -2.36e-5
2097  apm = 3.02e-3
2098 #endif
2099 #ifdef W3_ST2
2100  sdsa0 = 4.8
2101  sdsa1 = 1.7e-4
2102  sdsa2 = 2.0
2103  sdsb0 = 0.3e-3
2104  sdsb1 = 0.47
2105  phimin = 0.003
2106  sdsaln = 0.002
2107  fpimin = 0.009
2108 #endif
2109 #ifdef W3_ST3
2110  sdsc1 = -2.1 !! This is Bidlot et al. 2005, Otherwise WAM4 uses -4.5
2111  wnmeanp = 0.5 !! This is Bidlot et al. 2005, Otherwise WAM4 uses -0.5
2112  fxfm3 = 2.5
2113  fxpm3 = 4.
2114  wnmeanptail = 0.5
2115  sdsdelta1 = 0.4 !! This is Bidlot et al. 2005, Otherwise WAM4 uses 0.5
2116  sdsdelta2 = 0.6 !! This is Bidlot et al. 2005, Otherwise WAM4 uses 0.5
2117 #endif
2118  !
2119 #ifdef W3_ST4
2120  wnmeanp = 0.5 ! taken from Bidlot et al. 2005
2121  fxfm3 = 2.5
2122  fxfmage = 0.
2123  fxpm3 = 4.
2124  wnmeanptail = -0.5
2125  sdsbchoice =1 ! 1: Ardhuin et al., 2: Filipot & Ardhuin, 3: Romero
2126  sdsc2 = -2.2e-5 ! -3.8 for Romero
2127  sdscum = -0.40344
2128  sdsc4 = 1.
2129  sdsc5 = 0.
2130  sdsnuw = 0.
2131  sdsc6 = 0.3
2132  sdsbr = 0.90e-3 ! 0.005 for Romero
2133  sdsbrfdf = 0
2134  sdsbrf1 = 0.5
2135  sdsp = 2. ! this is now fixed in w3sds4, should be cleaned up
2136  sdsdth = 80.
2137  sdscos = 2.
2138  sdsiso = 2
2139  sdsbm0 = 1. ! All these parameters are related to finite depth
2140  sdsbm1 = 0. ! scaling of breaking
2141  sdsbm2 = 0.
2142  sdsbm3 = 0.
2143  sdsbm4 = 0.
2144  sdsbck = 0.
2145  sdsabk = 1.5
2146  sdspbk = 4.
2147  sdsbint = 0.3
2148  sdshck = 1.5
2149  whitecapwidth = 0.3
2150  sdsfacmtf = 400 ! MTF factor for Lambda , Romero (2019)
2151  cumsigp = 0.
2152  sdsstrain = 0.
2153  sdsstraina = 15.
2154  sdsstrain2 = 0.
2155  whitecapdur = 0.56 ! breaking duration factor
2156  ! b (strength of breaking)
2157  sdsbt = 1.100e-3 ! B_T (sturation threshold for dissipation rate b)
2158  ! Lambda parameters
2159  sdsl = 3.5000e-05 ! L scaling
2160  ! MTF
2161  spmss = 0.5 ! cmss^SPMSS
2162  sdsnmtf = 1.5 ! MTF power
2163  sdscump = 2. ! 2 for cumulative mss, 1 for cumulative orb. vel.
2164  ! MW
2165  sdsmwd = .9 ! new AFo
2166  sdsmwpow = 1. ! (k )^pow
2167  sdkof = 3. ! ko factor such that ko= g (SDKOF/(28 us))^2
2168 #endif
2169  !
2170 #ifdef W3_ST6
2171  sdset = .true.
2172  sdsa1 = 4.75e-06
2173  sdsp1 = 4
2174  sdsa2 = 7.00e-05
2175  sdsp2 = 4
2176  cstb1 = .false.
2177  swlb1 = 0.41e-02
2178 #endif
2179  !
2180 #ifdef W3_ST1
2181  CALL readnl ( ndss, 'SDS1', status )
2182  WRITE (ndso,924) status
2183  WRITE (ndso,925) cdis, apm
2184  sdsc1 = tpi * cdis / apm**2
2185 #endif
2186  !
2187 #ifdef W3_ST2
2188  CALL readnl ( ndss, 'SDS2', status )
2189  WRITE (ndso,924) status
2190  IF ( phimin .LE. 0. ) THEN
2191  sdsb2 = 0.
2192  sdsb3 = 0.
2193  phimin = sdsb0 + sdsb1*fpimin
2194  ELSE
2195  fpia = ( phimin - sdsb0 ) / sdsb1
2196  IF ( fpia .LT. fpimin ) THEN
2197  sdsb3 = 4.
2198  sdsb2 = fpimin**sdsb3 * (phimin-sdsb0-sdsb1*fpimin)
2199  ELSE
2200  fpib = max( fpia-0.0025 , fpimin )
2201  dphid = max( phimin - sdsb0 - sdsb1*fpib , 1.e-15 )
2202  sdsb3 = min( 10. , sdsb1*fpib / dphid )
2203  sdsb2 = fpib**sdsb3 * dphid
2204  fpimin = fpib
2205  END IF
2206  END IF
2207  WRITE (ndso,925) sdsa0, sdsa1, sdsa2, &
2208  sdsb0, sdsb1, sdsb2, sdsb3, fpimin, phimin
2209  cdsa0 = sdsa0
2210  cdsa1 = sdsa1
2211  cdsa2 = sdsa2
2212  cdsb0 = sdsb0
2213  cdsb1 = sdsb1
2214  cdsb2 = sdsb2
2215  cdsb3 = sdsb3
2216 #endif
2217  !
2218 #ifdef W3_ST3
2219  CALL readnl ( ndss, 'SDS3', status )
2220  WRITE (ndso,924) status
2221  WRITE (ndso,925) sdsc1, wnmeanp, sdsdelta1, &
2222  sdsdelta2
2223  ssdsc1 = sdsc1
2224  wwnmeanp = wnmeanp
2225  ffxfm = fxfm3 * tpi
2226  ffxpm = fxpm3 * grav / 28.
2227  wwnmeanptail = wnmeanptail
2228  ddelta1 = sdsdelta1
2229  ddelta2 = sdsdelta2
2230 #endif
2231  !
2232 #ifdef W3_ST4
2233  CALL readnl ( ndss, 'SDS4', status )
2234  WRITE (ndso,924) status
2235  WRITE (ndso,925) sdsc2, sdsbck, sdscum, wnmeanp
2236  ssdsc(1) = real(sdsbchoice)
2237  ssdsc(2) = sdsc2
2238  ssdsc(3) = sdscum
2239  ssdsc(4) = sdsc4
2240  ssdsc(5) = sdsc5
2241  ssdsc(6) = sdsc6
2242  ssdsc(7) = whitecapwidth
2243  ssdsc(8) = sdsstrain ! Straining constant ...
2244  ssdsc(9) = sdsl
2245  ssdsc(10) = sdsstraina*nth/360. ! angle for enhanced straining
2246  ssdsc(11) = sdsstrain2 ! straining constant for directional part
2247  ssdsc(12) = cumsigp
2248  ssdsc(13) = sdsmwd
2249  ssdsc(14) = spmss
2250  ssdsc(15) = sdsmwpow
2251  ssdsc(16) = sdkof
2252  ssdsc(17) = whitecapdur
2253  ssdsc(18) = sdsfacmtf
2254  ssdsc(19) = sdsnmtf
2255  ssdsc(20) = sdscump
2256  ssdsc(21) = sdsnuw
2257  !
2258  ssdsbr = sdsbr
2259  ssdsbrf1 = sdsbrf1
2260  ssdsbrfdf= sdsbrfdf
2261  ssdsbm(0) = sdsbm0
2262  ssdsbm(1) = sdsbm1
2263  ssdsbm(2) = sdsbm2
2264  ssdsbm(3) = sdsbm3
2265  ssdsbm(4) = sdsbm4
2266  ssdsbt = sdsbt
2267  ssdsiso = sdsiso
2268  ssdscos = sdscos
2269  ssdsp = sdsp
2270  ssdsdth = sdsdth
2271  wwnmeanp = wnmeanp
2272  ffxfm = fxfm3 * tpi
2273  ffxfa = fxfmage * tpi
2274  ffxpm = fxpm3 * grav / 28.
2275  wwnmeanptail = wnmeanptail
2276  ssdsbck = sdsbck
2277  ssdsabk = sdsabk
2278  ssdspbk = sdspbk
2279  ssdsbint = sdsbint
2280  ssdshck = sdshck
2281 #endif
2282  !
2283 #ifdef W3_ST6
2284  CALL readnl ( ndss, 'SDS6', status )
2285  WRITE (ndso,924) status
2286  sds6et = sdset
2287  sds6a1 = sdsa1
2288  sds6p1 = sdsp1
2289  sds6a2 = sdsa2
2290  sds6p2 = sdsp2
2291  j = 2
2292  IF (sdset) j = 1
2293  WRITE (ndso,925) yesxno(j), yesxno(3-j), sds6a1, sds6p1, sds6a2, sds6p2
2294 
2295  CALL readnl ( ndss, 'SWL6', status )
2296  WRITE (ndso,937) status
2297  j = 1
2298  swl6s6 = swlb1.GT.0.0
2299  IF (.NOT.swl6s6) j = 2
2300  swl6b1 = swlb1
2301  swl6cstb1 = cstb1
2302  IF (cstb1) THEN
2303  WRITE (ndso,940) yesxno(j), '(constant) ' ,swl6b1
2304  ELSE
2305  WRITE (ndso,940) yesxno(j), '(steepness dependent)' ,swl6b1
2306  END IF
2307 #endif
2308  !
2309  ! 6.g Define Sbt.
2310  !
2311 #ifdef W3_BT0
2312  WRITE (ndso,926)
2313 #endif
2314 #ifdef W3_BT4
2315  WRITE (ndso,926)
2316 #endif
2317  !
2318 #ifdef W3_BT1
2319  gamma = -0.067
2320  CALL readnl ( ndss, 'SBT1', status )
2321  WRITE (ndso,926) status
2322  WRITE (ndso,927) gamma
2323  sbtc1 = 2. * gamma / grav
2324 #endif
2325  !
2326 #ifdef W3_BT4
2327  sedmapd50=.false.
2328  sed_d50_uniform=2.e-4 ! default grain size: medium sand 200 microns
2329  ripfac1=0.4 ! A1 in Ardhuin et al. 2003
2330  ripfac2=-2.5 ! A2 in Ardhuin et al. 2003
2331  ripfac3=1.2 ! A3 in Ardhuin et al. 2003
2332  ripfac4=0.05 ! A4 in Ardhuin et al. 2003
2333  sigdepth=0.05
2334  botroughmin=0.01
2335  botroughfac=1.00
2336  CALL readnl ( ndss, 'SBT4', status )
2337  WRITE (ndso,926) status
2338  WRITE (ndso,927) sedmapd50, sed_d50_uniform, &
2339  ripfac1,ripfac2,ripfac3,ripfac4,sigdepth, &
2340  botroughmin, botroughfac
2341  sbtcx(1)=ripfac1
2342  sbtcx(2)=ripfac2
2343  sbtcx(3)=ripfac3
2344  sbtcx(4)=ripfac4
2345  sbtcx(5)=sigdepth
2346  sbtcx(6)=botroughmin
2347  sbtcx(7)=botroughfac
2348 #endif
2349  !
2350  !
2351  ! 6.h Define Sdb.
2352  !
2353 #ifdef W3_DB0
2354  WRITE (ndso,928)
2355 #endif
2356  !
2357 #ifdef W3_DB1
2358  bjalfa = 1.
2359  bjgam = 0.73
2360  bjflag = .true.
2361  CALL readnl ( ndss, 'SDB1', status )
2362  WRITE (ndso,928) status
2363  bjalfa = max( 0. , bjalfa )
2364  bjgam = max( 0. , bjgam )
2365  WRITE (ndso,929) bjalfa, bjgam
2366  IF ( bjflag ) THEN
2367  WRITE (ndso,*) ' Using Hmax/d ratio only.'
2368  ELSE
2369  WRITE (ndso,*) &
2370  ' Using Hmax/d in Miche style formulation.'
2371  END IF
2372  WRITE (ndso,*)
2373  sdbc1 = bjalfa
2374  sdbc2 = bjgam
2375  fdonly = bjflag
2376 #endif
2377  !
2378  !
2379 #ifdef W3_UOST
2380  uostfilelocal = 'obstructions_local.'//adjustl(trim(gname))//'.in'
2381  uostfileshadow = 'obstructions_shadow.'//adjustl(trim(gname))//'.in'
2382  uostfactorlocal = 1
2383  uostfactorshadow = 1
2384  CALL readnl ( ndss, 'UOST', status )
2385  WRITE (ndso,4500) status
2386  WRITE (ndso,4501) adjustl(trim(uostfilelocal)), adjustl(trim(uostfileshadow)), &
2387  uostfactorlocal, uostfactorshadow
2388 #endif
2389  !
2390  ! 6.i Define Str.
2391  !
2392 #ifdef W3_TR0
2393  WRITE (ndso,930)
2394 #endif
2395  !
2396  ! 6.j Define Sbs.
2397  !
2398 #ifdef W3_BS0
2399  WRITE (ndso,932)
2400 #endif
2401 #ifdef W3_BS1
2402  WRITE (ndso,932)
2403 #endif
2404  !
2405  ! 6.k Define Sxx and Sic.
2406  !
2407 #ifdef W3_IC1
2408  WRITE (ndso,935)
2409  WRITE(ndso,'(A/A)')' Sice will be calculated using ' &
2410  //'user-specified ki values.',' Required ' &
2411  //'field input: ice parameter 1.'
2412 #endif
2413  !
2414 #ifdef W3_IC2
2415  WRITE (ndso,935)
2416  WRITE(ndso,'(A/A)')' Sice will be calculated using ' &
2417  //'under-ice boundary layer method.',' Required ' &
2418  //'field input: ice parameters 1 and 2.'
2419 #endif
2420  !
2421 #ifdef W3_IC3
2422  WRITE (ndso,935)
2423  WRITE(ndso,'(A/A)')' Sice will be calculated using '&
2424  //'Wang and Shen method.',' '&
2425  //'Required field input: ice parameters 1, 2, 3 and 4.'
2426 #endif
2427  !
2428 #ifdef W3_IC4
2429  WRITE (ndso,935)
2430  WRITE(ndso,'(A/A)')' Sice will be calculated using '&
2431  //'Empirical method.',' '&
2432  //'Required field input: ice parameters (varies).'
2433 #endif
2434  !
2435 #ifdef W3_IC5
2436  WRITE (ndso,935)
2437  WRITE(ndso,'(A/A/)')' Sice will be calculated using '&
2438  //'effective medium models.',' '&
2439  //'Required field input: ice parameters 1, 2, 3 and 4.'
2440 #endif
2441  !
2442  ! 6.l Read unstructured data
2443  ! initialisation of logical related to unstructured grid
2444  ugobcauto = .true.
2445  ugbccfl = .true.
2446  ugobcdepth= -10.
2447  ugobcok = .false.
2448  ugobcfile = 'unset'
2449  expfsn = .true.
2450  expfspsi = .false.
2451  expfsfct = .false.
2452  impfsn = .false.
2453  imptotal = .false.
2454  exptotal = .false.
2455  imprefraction = .false.
2456  impfreqshift = .false.
2457  impsource = .false.
2458  setup_apply_wlv = .true.
2459  solverthr_setup=1e-6
2460  crit_dep_setup=0.1
2461  jgs_terminate_maxiter = .true.
2462  jgs_terminate_difference = .true.
2463  jgs_terminate_norm = .false.
2464  jgs_limiter = .false.
2465  jgs_limiter_func = 1
2466  jgs_block_gauss_seidel = .true.
2467  jgs_use_jacobi = .true.
2468  jgs_maxiter=100
2469  jgs_pmin = 1
2470  jgs_diff_thr = 1.e-10
2471  jgs_norm_thr = 1.e-20
2472  jgs_nlevel = 0
2473  jgs_source_nonlinear = .false.
2474  ! read data from the unstructured devoted namelist
2475  CALL readnl ( ndss, 'UNST', status )
2476 
2477  b_jgs_use_jacobi = jgs_use_jacobi
2478  b_jgs_terminate_maxiter = jgs_terminate_maxiter
2479  b_jgs_terminate_difference = jgs_terminate_difference
2480  b_jgs_terminate_norm = jgs_terminate_norm
2481  b_jgs_limiter = jgs_limiter
2482  b_jgs_limiter_func = jgs_limiter_func
2483  b_jgs_block_gauss_seidel = jgs_block_gauss_seidel
2484  b_jgs_maxiter = jgs_maxiter
2485  b_jgs_pmin = jgs_pmin
2486  b_jgs_diff_thr = jgs_diff_thr
2487  b_jgs_norm_thr = jgs_norm_thr
2488  b_jgs_nlevel = jgs_nlevel
2489  b_jgs_source_nonlinear = jgs_source_nonlinear
2490 
2491  nbsel=0
2492 
2493  IF (expfsn) nbsel = nbsel+1
2494  IF (expfspsi) nbsel = nbsel+1
2495  IF (expfsfct) nbsel = nbsel+1
2496  IF (impfsn) nbsel = nbsel+1
2497  IF (imptotal) nbsel = nbsel+1
2498  IF (exptotal) nbsel = nbsel+1
2499 
2500  IF (gtype .EQ. ungtype) THEN
2501  IF (nbsel .ne. 1) THEN
2502  IF (nbsel .gt. 1) THEN
2503  WRITE (ndse,*) 'MORE THAN ONE UNSTRUCTURED SCHEME SELECTED'
2504  CALL extcde ( 19 )
2505  ELSE IF (nbsel .eq. 0) THEN
2506  WRITE (ndse,*) 'NOTHING SELECTED FROM THE UNSTRUCTURED PART'
2507  CALL extcde ( 19 )
2508  END IF
2509  END IF
2510  END IF
2511  !
2512  ! 6.m Select propagation scheme
2513  !
2514  WRITE (ndso,950)
2515  !
2516  nrprop = 0
2517  flprop = .true.
2518  pname = ' '
2519 #ifdef W3_PR0
2520  pname = 'Not defined '
2521  nrprop = nrprop + 1
2522  flprop = .false.
2523 #endif
2524 #ifdef W3_PR1
2525  pname = 'First order upstream '
2526  nrprop = nrprop + 1
2527 #endif
2528 #ifdef W3_UQ
2529  pname = '3rd order UQ'
2530 #endif
2531 #ifdef W3_UNO
2532  pname = '2nd order UNO'
2533 #endif
2534  j = len_trim(pname)
2535 #ifdef W3_PR2
2536  pname = pname(1:j)//' + GSE diffusion '
2537  nrprop = nrprop + 1
2538 #endif
2539 #ifdef W3_PR3
2540  pname = pname(1:j)//' + GSE averaging '
2541  nrprop = nrprop + 1
2542 #endif
2543  !
2544 #ifdef W3_SMC
2545  pname = 'UNO2 on SMC grid + diffusion '
2546 #endif
2547  !
2548  IF ( (flcx.OR.flcy.OR.flcth.OR.flck) .AND. .NOT. flprop ) THEN
2549  WRITE (ndse,1030)
2550  CALL extcde ( 20 )
2551  END IF
2552  !
2553  IF ( .NOT.(flcx.OR.flcy.OR.flcth.OR.flck) .AND. flprop ) THEN
2554  WRITE (ndse,1031)
2555  END IF
2556  !
2557  IF ( nrprop.EQ.0 ) THEN
2558  WRITE (ndse,1032)
2559  CALL extcde ( 21 )
2560  END IF
2561  !
2562  IF ( nrprop .GT. 1 ) THEN
2563  WRITE (ndse,1033) nrprop
2564  CALL extcde ( 22 )
2565  END IF
2566  !
2567  ! 6.m Parameters for propagation scheme
2568  !
2569  WRITE (ndso,951) pname
2570  !
2571  cfltm = 0.7
2572  !
2573 #ifdef W3_PR2
2574  dtime = 0.
2575  latmin = 70.
2576 #endif
2577  !
2578 #ifdef W3_SMC
2579  !! Default values of SMC grid parameters. JGLi06Apr2021
2580  ncel = 1
2581  nufc = 1
2582  nvfc = 1
2583  nglo = 1
2584  narc = 1
2585  nbgl = 1
2586  nbac = 1
2587  lvsmc = 1
2588  mrfct = 1
2589  ishft = 0
2590  jeqt = 0
2591  nbismc = 0
2592  cflsm = 0.7
2593  dtims = 360.0
2594  rfmaxd = 36.0
2595  uno3 = .false.
2596  averg = .true.
2597  seawnd = .false.
2598  arctic = .false.
2599 #endif
2600  !
2601 #ifdef W3_PR3
2602  wdthcg = 1.5
2603  wdthth = wdthcg
2604 #endif
2605  !
2606 #ifdef W3_PR1
2607  CALL readnl ( ndss, 'PRO1', status )
2608  IF ( status(18:18) .EQ. ':' ) status(18:18) = ' '
2609  WRITE (ndso,952) status(1:18)
2610  cfltm = max( 0. , cfltm )
2611  WRITE (ndso,953) cfltm
2612 #endif
2613  !
2614 #ifdef W3_PR2
2615  CALL readnl ( ndss, 'PRO2', status )
2616  IF ( status(18:18) .EQ. ':' ) status(18:18) = ' '
2617  WRITE (ndso,952) status(1:18)
2618  cfltm = max( 0. , cfltm )
2619  dtime = max( 0. , dtime )
2620  latmin = min( 89. , abs(latmin) )
2621  clatmn = cos( latmin * dera )
2622  IF ( dtime .EQ. 0. ) THEN
2623  WRITE (ndso,953) cfltm, latmin
2624  ELSE
2625  WRITE (ndso,954) cfltm, dtime/3600., latmin
2626  END IF
2627  dtme = dtime
2628 #endif
2629  !
2630 #ifdef W3_SMC
2631  CALL readnl ( ndss, 'PSMC', status )
2632  IF ( status(18:18) .EQ. ':' ) status(18:18) = ' '
2633  WRITE (ndso,952) status(1:18)
2634  cflsm = max( 0. , cflsm )
2635  dtims = max( 0. , dtims )
2636  rfmaxd = min( 80.0, abs(rfmaxd) )
2637  refran = rfmaxd * dera
2638  !! Printing out SMC grid parameters.
2639  WRITE (ndso,1950)
2640  WRITE (ndso,1951) pnsmc
2641  WRITE (ndso,1953) cflsm, dtims/3600., rfmaxd
2642  funo3 = uno3
2643  fverg = averg
2644  fswnd = seawnd
2645  arctc = arctic
2646  nbsmc = nbismc
2647  IF( funo3 ) WRITE (ndso,*) &
2648  " Advection use 3rd order UNO3 instead of UNO2 scheme."
2649  IF( fverg ) WRITE (ndso,*) &
2650  " Extra 1-2-1 average smoothing activated on SMC grid."
2651  IF( fswnd ) WRITE (ndso,*) &
2652  " Sea-point only wind input is required for SMC grid. "
2653  IF( arctc ) WRITE (ndso,*) &
2654  " Arctic polar part will be appended to this SMC grid."
2655  nrlv = lvsmc
2656  WRITE (ndso,4001) nrlv
2657  WRITE (ndso,4002) jeqt
2658  WRITE (ndso,4302) ishft
2659  WRITE (ndso,4003) nbsmc
2660 #endif
2661  !
2662 #ifdef W3_PR3
2663  CALL readnl ( ndss, 'PRO3', status )
2664  IF ( status(18:18) .EQ. ':' ) status(18:18) = ' '
2665 #endif
2666  IF (gtype.NE.ungtype) THEN
2667 #ifdef W3_PR3
2668  WRITE (ndso,952) status(1:18)
2669  cfltm = max( 0. , cfltm )
2670  WRITE (ndso,953) cfltm, wdthcg
2671  IF ( wdthcg*(xfr-1.) .GT. 1. ) WRITE (ndso,955) 1./(xfr-1.)
2672  WRITE (ndso,954) wdthth
2673  IF ( wdthth*dth .GT. 1. ) WRITE (ndso,955) 1./dth
2674  WRITE (ndso,*)
2675 #endif
2676  ENDIF
2677 #ifdef W3_PR3
2678  wdcg = wdthcg
2679  wdth = wdthth
2680 #endif
2681  !
2682  ctmax = cfltm
2683  !
2684 #ifdef W3_RTD
2685  ! Set/ read in rotation values - these will be written out
2686  ! later with the rest of the grid info
2687  ! Default is a non-rotated lat-lon grid
2688  plat = 90.
2689  plon = -180.
2690  unrot = .false.
2691  CALL readnl ( ndss, 'ROTD', status )
2692  plon = mod( plon + 180., 360. ) - 180.
2693  ! Ensure that a grid with pole at the geographic North is standard lat-lon
2694  IF ( plat == 90. .AND. ( plon /= -180. .OR. unrot ) ) THEN
2695  WRITE( ndse, 1052 )
2696  CALL extcde ( 33 )
2697  ENDIF
2698  ! Default poles of output b. c. are non-rotated:
2699  bplat = 90.
2700  bplon = -180.
2701  CALL readnl ( ndss, 'ROTB', status )
2702  ! A b. c. dest. grid with pole at the geographic North must be non-rotated
2703  DO i=1,9
2704  IF ( bplat(i) == 90. ) THEN
2705  ! Require BPLON(I) == -180., but don't blaim the user if BPLON(I) == 180.
2706  IF ( bplon(i) == 180. ) bplon(i) = -180.
2707  IF ( bplon(i) == -180. ) cycle
2708  END IF
2709  IF ( bplat(i) < 90. ) cycle
2710  WRITE( ndse, 1053 )
2711  CALL extcde ( 34 )
2712  END DO
2713 #endif
2714  !
2715  ! 6.n Set miscellaneous parameters (ice, seeding, numerics ... )
2716  !
2717  cice0 = 0.5
2718  cicen = 0.5
2719  lice = 0.
2720  icehfac= 1.0
2721  icehmin= 0.2 ! the 0.2 value is arbitrary and needs to be tuned.
2722  icehinit= 0.5
2723  icesln = 1.0
2724  icewind= 1.0
2725  icesnl = 1.0
2726  icesds = 1.0
2727  icehdisp= 0.6 ! Prevent from convergence crash in w3dispmd in the presence of ice, should be tuned
2728  iceddisp= 80
2729  icefdisp= 2
2730  gshift = 0.0d0
2731  pmove = 0.5
2732  xseed = 1.
2733  flagtr = 0
2734  xp = 0.15
2735  xr = 0.10
2736  xfilt = 0.05
2737  ihm = 100
2738  hspm = 0.05
2739  wsm = 1.7
2740  wsc = 0.333
2741  flc = .true.
2742  trckcmpr = .true.
2743  nosw = 5
2744  !
2745  ! Gas fluxes
2746  !
2747  aircmin = 2.0 ! cmin for whitecap coverage and entrained air
2748  airgb = 0.2 ! volume of entrained air constant (Deike et al. 2017)
2749  !
2750 #ifdef W3_NCO
2751  ! NCEP operations retains first three swell systems.
2752  nosw=3
2753 #endif
2754  ptm = 1 ! Default to standard WW3 partitioning. C. Bunney
2755  ptfc = 0.1 ! Part. method 5 cutoff freq default. C. Bunney
2756  fmiche = 1.6
2757  rwndc = 1.
2758  wcor1 = 99.
2759  wcor2 = 0.
2760  btbet = 1.2 ! β for c / [U cos(θ - φ)] < β
2761  ! Variables for Space-Time Extremes
2762  ! Default negative values make w3iogomd switch off space-time extremes
2763  ! forces user to provide NAMELIST if wanting to compute STE parameters
2764  stdx = -1.
2765  stdy = -1.
2766  stdt = -1.
2767  icedisp = .false.
2768  caltype = 'standard'
2769  ! Variables for 3D array output
2770  e3d=0
2771  i1e3d=1
2772  i2e3d=nk
2773  p2sf = 0
2774  i1p2sf = 1
2775  i2p2sf = 15
2776  us3d = 0
2777  i1us3d = 1
2778  i2us3d = nk
2779  ussp=0
2780  iussp=1
2781  stk_wn(:)=0.0
2782  stk_wn(1)=tpi/100. !Set default decay of 100 m for Stokes drift
2783  th1mf=0
2784  i1th1m=1
2785  i2th1m=nk
2786  sth1mf=0
2787  i1sth1m=1
2788  i2sth1m=nk
2789  th2mf=0
2790  i1th2m=1
2791  i2th2m=nk
2792  sth2mf=0
2793  i1sth2m=1
2794  i2sth2m=nk
2795  !
2796  facberg=1.
2797 #ifdef W3_IS0
2798  WRITE (ndso,944)
2799 #endif
2800 #ifdef W3_IS1
2801  isc1 = 1.
2802  isc2 = 0.
2803  CALL readnl ( ndss, 'SIS1', status )
2804  WRITE (ndso,945) status
2805  WRITE (ndso,946) isc1, isc2
2806  is1c1 = isc1
2807  is1c2 = isc2
2808 #endif
2809 #ifdef W3_IS2
2810  isc1 = 1.
2811  is2c2 = 0. ! 0.025
2812  is2c3 = 0. ! 2.4253
2813  is2conc = 0.
2814  is2backscat = 1.
2815  is2break = .false.
2816  is2breakf = 3.6
2817  is2flexstr=6.00e+05 ! value used in Ardhuin et al. 2020
2818  is2isoscat=.true. ! uses isotropic back-scatter
2819  is2disp=.false. !not dispersion only attenuation following Liu disp. eq.
2820  is2dupdate=.true.
2821  is2fragility=0.9
2822  is2dmin=20
2823  is2damp=0.
2824  is2creepb=0.
2825  is2creepc=0.4 ! This gives an impact of break-up over a wider freq. range
2826  ! ! compared to the 0.2 value in Boutin et al. 2018
2827  is2creepd=0.5
2828  is2creepn=3.0
2829  is2breake=1.
2830  is2wim1=1.
2831  is2andisb=.true. !anelastic instead of inelastic dissipation if IS2CREEPB>0
2832  is2andise=0.55 !energy of activation
2833  is2andisd=2.0e-9 !see Ardhuin et al. 2020
2834  is2andisn=1. !dependency on stress. Equal to 1 normally?
2835  CALL readnl ( ndss, 'SIS2', status )
2836  WRITE (ndso,947) status
2837  WRITE (ndso,2948) isc1, is2backscat, is2isoscat, is2break, is2dupdate, is2flexstr, is2disp, &
2838  is2damp, is2fragility, is2dmin, is2c2, is2c3, is2conc, is2creepb,&
2839  is2creepc, is2creepd, is2creepn, is2breake, is2breakf, is2wim1, &
2840  is2andisb, is2andise, is2andisd, is2andisn
2841 #endif
2842  !
2843 #ifdef W3_REF1
2844  refcoast=0.
2845  refmap=0.
2846  refmapd=0.
2847  refrmax=1.
2848  reffreqpow=2.
2849  reffreq=0.
2850  refcosp_straight=4.
2851  refslope=0.22
2852  refsubgrid=0.
2853  reficeberg=0.
2854  refunstsource=0.
2855  !
2856  CALL readnl ( ndss, 'REF1', status )
2857  WRITE (ndso,969) status
2858 #endif
2859  !
2860 #ifdef W3_IG1
2861  igmethod = 2
2862  igaddoutp= 0
2863  igsource = 2
2864  igsterms = 0
2865  igmaxfreq=0.03
2866  igsourceatbp = 0
2867  igbcoverwrite = .true.
2868  igswellmax = .true.
2869  igkdmin = 1.1
2870  igfixeddepth = 0.
2871  igempirical = 0.00125
2872  CALL readnl ( ndss, 'SIG1 ', status )
2873  WRITE (ndso,970) status
2874 #endif
2875  !
2876 #ifdef W3_IC2
2877  ic2disper = .false.
2878  ic2turb = 1.
2879  ic2turbs = 0.
2880  ic2rough = 0.01
2881  ic2reynolds = 1.5e5
2882  ic2smooth = 2e5
2883  ic2visc = 1.
2884  ic2dmax = 0.
2885 #endif
2886  !
2887 #ifdef W3_IC3
2888  ic3maxthk = 100.0
2889  ic3maxcnc = 100.0
2890  ic2turb = 2.0 ! from run_test example by F.A.
2891  ic2turbs = 0.
2892  ic2rough = 0.02 ! from run_test example by F.A. (alt:0.1)
2893  ic2reynolds = 1.5e5
2894  ic2smooth = 7.0e4
2895  ic2visc = 2.0
2896  ic3cheng = .true.
2897  usecgice = .false.
2898  ic3hilim = 100.0
2899  ic3kilim = 100.0
2900  ic3hice = -1.0
2901  ic3visc = -2.0
2902  ic3dens = -3.0
2903  ic3elas = -4.0
2904 #endif
2905  !fixme: if USECGICE = .TRUE., don't allow use of IC3MAXTHK<100.0
2906 
2907 #ifdef W3_IC4
2908  ic4method = 1 !switch for methods within IC4
2909  ic4ki=0.0
2910  ic4fc=0.0
2911  ic4cn=0.0
2912  ic4fmin=0.0
2913  ic4kibk=0.0
2914 #endif
2915  !
2916 #ifdef W3_IC5
2917  ic5minig = 1.
2918  ic5minwt = 0.
2919  ic5maxkratio = 1e9
2920  ic5maxki = 100.
2921  ic5minhw = 0.
2922  ic5maxiter = 100.
2923  ic5rkick = 0.
2924  ic5kfilter = 0.0025
2925  ic5vemod = 3. ! 1: EFS, 2: RP, 3: M2 (default)
2926 #endif
2927  !
2928 #ifdef W3_IC2
2929  CALL readnl ( ndss, 'SIC2 ', status )
2930  WRITE (ndso,971) status
2931 #endif
2932  !
2933 #ifdef W3_IC3
2934  CALL readnl ( ndss, 'SIC3 ', status )
2935  WRITE (ndso,971) status
2936 #endif
2937  !
2938 #ifdef W3_IC4
2939  CALL readnl ( ndss, 'SIC4 ', status )
2940  WRITE (ndso,971) status
2941 #endif
2942  !
2943 #ifdef W3_IC5
2944  CALL readnl ( ndss, 'SIC5 ', status )
2945  ic5vemod = min(max(1., ic5vemod), 3.)
2946  WRITE (ndso,971) status
2947  WRITE (ndso,2971) ic5minig, ic5minwt, ic5maxkratio, &
2948  ic5maxki, ic5minhw, ic5maxiter, ic5rkick, &
2949  ic5kfilter, ic5mstr(nint(ic5vemod))
2950 #endif
2951  !
2952  CALL readnl ( ndss, 'OUTS', status )
2953  WRITE (ndso,4970) status
2954  !
2955  !
2956  ! output of frequency spectra, th1m ...
2957  !
2958  e3df(1,1) = e3d
2959  e3df(2,1) = min(max(1,i1e3d),nk)
2960  e3df(3,1) = min(max(1,i2e3d),nk)
2961  e3df(1,2) = th1mf
2962  e3df(2,2) = min(max(1,i1th1m),nk)
2963  e3df(3,2) = min(max(1,i2th1m),nk)
2964  e3df(1,3) = sth1mf
2965  e3df(2,3) = min(max(1,i1sth1m),nk)
2966  e3df(3,3) = min(max(1,i2sth1m),nk)
2967  e3df(1,4) = th2mf
2968  e3df(2,4) = min(max(1,i1th2m),nk)
2969  e3df(3,4) = min(max(1,i2th2m),nk)
2970  e3df(1,5) = sth2mf
2971  e3df(2,5) = min(max(1,i1sth2m),nk)
2972  e3df(3,5) = min(max(1,i2sth2m),nk)
2973  !
2974  ! output of microseismic source spectra
2975  !
2976  p2msf(1) = p2sf
2977  p2msf(2) = min(max(1,i1p2sf),nk)
2978  p2msf(3) = min(max(1,i2p2sf),nk)
2979  !
2980  ! output of Stokes drift profile
2981  !
2982  us3df(1) = us3d
2983  us3df(2) = max( 1 , min( nk, i1us3d) )
2984  us3df(3) = max( 1 , min( nk, i2us3d) )
2985  !
2986  ! output of Stokes drift partitions
2987  !
2988  usspf(1) = ussp
2989  usspf(2) = max( 1 , min(25, iussp ) )
2990  IF (iussp.GT.25) THEN
2991  WRITE(ndse,*) ' *** WAVEWATCH III ERROR IN ww3_grid:'
2992  WRITE(ndse,*) " Stokes drift partition outputs not "
2993  WRITE(ndse,*) " intended for use with more than 25 "
2994  WRITE(ndse,*) " partitions. Please reduce IUSSP "
2995  WRITE(ndse,*) " specified in ww3_grid.inp to proceed "
2996  CALL extcde( 31)
2997  ENDIF
2998 
2999  ussp_wn = 0.0 ! initialize to 0s
3000  DO j=1,usspf(2)
3001  ussp_wn(j) = stk_wn(j)
3002  ENDDO
3003 
3004  !
3005  WRITE (ndso,4971) p2msf(1:3)
3006  WRITE (ndso,4972) us3df(1:3)
3007  WRITE (ndso,4973) e3df(1:3,1)
3008  WRITE (ndso,4974) usspf(1:2)
3009  DO j=1,usspf(2)
3010  WRITE(ndso,4975) j,ussp_wn(j)
3011  ENDDO
3012  !
3013  CALL readnl ( ndss, 'MISC', status )
3014  WRITE (ndso,960) status
3015  !
3016  IF ( flagtr.LT.0 .OR. flagtr.GT.6 ) flagtr = 0
3017  cicen = min( 1. , max( 0. , cicen ) )
3018  icesln = min( 1. , max( 0. , icesln ) )
3019  icewind = min( 1. , max( 0. , icewind ) )
3020  icesds = min( 1. , max( 0. , icesds ) )
3021  icesnl = min( 1. , max( 0. , icesnl ) )
3022  ficen = cicen
3023  gridshift=gshift
3024  icescales(1)=icesln
3025  icescales(2)=icewind
3026  icescales(3)=icesnl
3027  icescales(4)=icesds
3028  cmprtrck=trckcmpr
3029  cice0 = min( cicen , max( 0. , cice0 ) )
3030  ficel = lice
3031  iicehmin = icehmin
3032  iicehfac = icehfac
3033  iicehinit = icehinit
3034  iicedisp= icedisp
3035  iicehdisp = icehdisp
3036  iiceddisp = iceddisp
3037  iicefdisp = icefdisp
3038  pmove = max( 0. , pmove )
3039  pfmove = pmove
3040  !
3041  btbeta = min(max(1., btbet), 2.)
3042  aaircmin = alog(grav/aircmin/sig(1))/alog(xfr)+1 ! goes from phase speed C=g/sig to index
3043  aairgb = airgb
3044  !
3045  ! Notes: Presently, if we select CICE0.ne.CICEN requires an obstruction
3046  ! grid, that is initialized with zeros as default.
3047  IF ( flagtr .LT. 3 ) THEN
3048  IF (cice0.NE.cicen) THEN
3049  cice0 = cicen
3050  IF (status=='(user def. values) :') WRITE (ndso,2961)
3051  END IF
3052  END IF
3053 #ifdef W3_IC0
3054  IF ( cice0.EQ.cicen .AND. flagtr.GE.3 ) flagtr = flagtr - 2
3055 #endif
3056  WRITE (ndso,961) cice0, cicen
3057  WRITE (ndso,8972) icewind
3058  fice0 = cice0
3059  ! Variables for Space-Time Extremes
3060  stexu = stdx
3061  IF ( stdy .LE. 0. ) THEN
3062  stdy = stdx
3063  END IF
3064  steyu = stdy
3065  stedu = stdt
3066  IF ( stdx .GT. 0 ) THEN
3067  WRITE (ndso,1040) stdx
3068  WRITE (ndso,1041) stdy
3069  ELSE
3070  WRITE (ndso,1042)
3071  END IF
3072  IF ( stdt .GT. 0 ) THEN
3073  WRITE (ndso,1043) stdt
3074  ELSE
3075  WRITE (ndso,1044)
3076  END IF
3077 #ifdef W3_MGG
3078  WRITE (ndso,962) pmove
3079 #endif
3080  !
3081 #ifdef W3_SEED
3082  xseed = max( 1. , xseed )
3083  WRITE (ndso,964) xseed
3084 #endif
3085 #ifdef W3_SCRIP
3086  WRITE (ndso,963) gshift
3087 #endif
3088  WRITE (ndso,1972) trckcmpr
3089  facsd = xseed
3090 #ifdef W3_RWND
3091  rwindc = rwndc
3092 #endif
3093 #ifdef W3_WCOR
3094  wwcor(1) = wcor1
3095  wwcor(2) = wcor2
3096 #endif
3097  !
3098  xp = max( 1.e-6 , xp )
3099  xr = max( 1.e-6 , xr )
3100  xrel = xr
3101  xfilt = max( 0. , xfilt )
3102  xflt = xfilt
3103  WRITE (ndso,965) xp, xr, xfilt
3104  facp = xp / pi * 0.62e-3 * tpi**4 / grav**2
3105  !
3106  ihmax = max( 50, ihm )
3107  hspmin = max( 0.0001 , hspm )
3108  wsmult = max( 1. , wsm )
3109  wscut = min( 1.0001 , max( 0. , wsc ) )
3110  flcomb = flc
3111  noswll = max( 1 , nosw )
3112  ptmeth = ptm ! Partitioning method. Chris Bunney (Jan 2016)
3113  ptfcut = ptfc ! Freq cutoff for partitiong method 5
3114  pmnam2 = ""
3115  IF( ptmeth .EQ. 1 ) THEN
3116  pmname = "WW3 default"
3117  ELSE IF( ptmeth .EQ. 2 ) THEN
3118  pmname = "Watershedding plus wind cut-off"
3119  ELSE IF( ptmeth .EQ. 3 ) THEN
3120  pmname = "Watershedding only"
3121  wscut = 0.0 ! We don't want to classify by ws frac
3122  pmnam2 = "WSC set to 0.0"
3123  ELSE IF( ptmeth .EQ. 4 ) THEN
3124  pmname = "Wind speed cut-off only"
3125  pmnam2 = "WSC set to 0.0, NOSW set to 1"
3126  wscut = 0.0 ! We don't want to classify by ws frac
3127  noswll = 1 ! Only ever one swell
3128  ELSE IF( ptmeth .EQ. 5 ) THEN
3129  WRITE(pmname, '("2-Band hi/low cutoff at ", F4.2,"Hz")') ptfcut
3130  pmnam2 = "WSC set to 0.0, NOSW set to 1"
3131  wscut = 0.0 ! We don't want to classify by ws frac
3132  noswll = 1 ! Only ever one swell
3133  ELSE
3134  WRITE( ndse, * ) &
3135  "*** Error - unknown partitioing method (PTM)! ***"
3136  CALL exit(1)
3137  ENDIF
3138 
3139  IF ( flcomb ) THEN
3140  j = 1
3141  ELSE
3142  j = 2
3143  END IF
3144  WRITE (ndso,966) ihmax, hspmin, wsmult, wscut, yesxno(j), noswll
3145  WRITE (ndso,5971) pmname
3146  IF( pmnam2 .NE. "" ) WRITE (ndso,5972) pmnam2
3147  !! WRITE (NDSO,966) IHMAX, HSPMIN, WSMULT, WSCUT, YESXNO(J)
3148  !
3149  fhmax = max( 0.01 , fmiche )
3150  j = 2
3151 #ifdef W3_MLIM
3152  j = 1
3153 #endif
3154  WRITE (ndso,967) fhmax, fhmax/sqrt(2.), yesxno(j)
3155  IF ( fhmax.LT.0.50 .AND. j.EQ.1 ) WRITE (ndst,968)
3156  !
3157  IF (trim(caltype) .NE. 'standard' .AND. &
3158  trim(caltype) .NE. '360_day' .AND. &
3159  trim(caltype) .NE. '365_day' ) GOTO 2003
3160  WRITE (ndst,1973) caltype
3161  WRITE (ndso,*)
3162  !
3163  ! 6.x Read values for FLD stress calculation
3164  !
3165 #ifdef W3_FLD1
3166  tailtype = 0
3167  taillev = 0.006
3168  tailt1 = 1.25
3169  tailt2 = 3.00
3170 #endif
3171 #ifdef W3_FLD2
3172  tailtype = 0
3173  taillev = 0.006
3174  tailt1 = 1.25
3175  tailt2 = 3.00
3176 #endif
3177  !
3178 #ifdef W3_FLD1
3179  CALL readnl ( ndss, 'FLD1', status )
3180  taillev = min( max( 0.0005 , taillev ), 0.04)
3181  tail_lev = taillev
3182  tail_id = tailtype
3183  tail_tran1 = tailt1
3184  tail_tran2 = tailt2
3185 #endif
3186 #ifdef W3_FLD2
3187  CALL readnl ( ndss, 'FLD2', status )
3188  taillev = min( max( 0.0005 , taillev ), 0.04)
3189  tail_lev = taillev
3190  tail_id = tailtype
3191  tail_tran1 = tailt1
3192  tail_tran2 = tailt2
3193 #endif
3194  !
3195  ! 6.o End of namelist processing
3196  !
3197  IF (flgnml) THEN
3198  CLOSE (ndss)
3199  ELSE
3200  CLOSE (ndss,status='DELETE')
3201  END IF
3202  !
3203  IF ( flnmlo ) THEN
3204  WRITE (ndso,917)
3205 #ifdef W3_FLX3
3206  WRITE (ndso,2810) cdmax*1.e3, ctype
3207 #endif
3208 #ifdef W3_FLX4
3209  WRITE (ndso,2810) cdfac
3210 #endif
3211 #ifdef W3_LN1
3212  WRITE (ndso,2820) clin, rfpm, rfhf
3213 #endif
3214 #ifdef W3_ST1
3215  WRITE (ndso,2920) cinp
3216 #endif
3217  IF ( .NOT. flstb2 ) THEN
3218 #ifdef W3_ST2
3219  WRITE (ndso,2920) zwnd, swellf
3220 #endif
3221  ELSE
3222 #ifdef W3_STAB2
3223  WRITE (ndso,2921) zwnd, swellf, stabsh, stabof, &
3224  cneg, cpos, fneg
3225 #endif
3226  END IF
3227  !
3228 #ifdef W3_ST3
3229  WRITE (ndso,2920) zwnd, alpha0, z0max, betamax, sinthp, zalp, &
3230  swellf
3231 #endif
3232 #ifdef W3_ST4
3233  WRITE (ndso,2920) zwnd, alpha0, z0max, betamax, sinthp, zalp, &
3234  tauwshelter, swellfpar, swellf, swellf2, swellf3, swellf4, &
3235  swellf5, swellf6, swellf7, z0rat, sinbr, sintable, tauwbug, viscstress, sintail1, sintail2, &
3236  capcha, chamin, cha0, ucap, sigmaucap
3237 #endif
3238 #ifdef W3_ST6
3239  WRITE (ndso,2920) sina0, sinws, sinfc
3240 #endif
3241 #ifdef W3_NL1
3242  WRITE (ndso,2922) lambda, nlprop, kdconv, kdmin, &
3243  snlcs1, snlcs2, snlcs3, &
3244  iqtype, tailnl, gqmnf1, &
3245  gqmnt1, gqmnq_om2, gqmthrsat, gqmthrcou,&
3246  gqamp1, gqamp2, gqamp3, gqamp4
3247 #endif
3248 #ifdef W3_NL2
3249  WRITE (ndso,2922) iqtype, tailnl, ndepth
3250  IF ( iqtype .EQ. 3 ) THEN
3251  IF ( ndepth .EQ. 1 ) THEN
3252  WRITE (ndso,3923) dpthnl(1)
3253  ELSE
3254  WRITE (ndso,4923) dpthnl(1)
3255  END IF
3256  WRITE (ndso,5923) dpthnl(2:ndepth-1)
3257  WRITE (ndso,6923) dpthnl(ndepth)
3258  END IF
3259 #endif
3260 #ifdef W3_NL3
3261  WRITE (ndso,2922) nqdef, msc, nsc, kdfd, kdfs
3262  IF ( nqdef .EQ. 1 ) THEN
3263  WRITE (ndso,3923) qparms(1:5)
3264  ELSE
3265  WRITE (ndso,4923) qparms(1:5)
3266  DO j=2, nqdef-1
3267  WRITE (ndso,5923) qparms((j-1)*5+1:j*5)
3268  END DO
3269  WRITE (ndso,6923) qparms((nqdef-1)*5+1:nqdef*5)
3270  END IF
3271 #endif
3272 #ifdef W3_NL4
3273  WRITE (ndso,2922) indtsa, altlp
3274 #endif
3275 #ifdef W3_NL5
3276  WRITE (ndso,2922) qr5dpt, qr5oml, qi5dis, qi5kev, qi5ipl, qi5pmx
3277 #endif
3278 #ifdef W3_NLS
3279  WRITE (ndso,8922) a34, fhfc, dnm, fc1, fc2, fc3
3280 #endif
3281 #ifdef W3_ST1
3282  WRITE (ndso,2924) cdis, apm
3283 #endif
3284 #ifdef W3_ST2
3285  WRITE (ndso,2924) sdsa0, sdsa1, sdsa2, sdsb0, sdsb1, phimin
3286 #endif
3287 #ifdef W3_ST3
3288  WRITE (ndso,2924) sdsc1, wnmeanp, fxpm3, fxfm3, sdsdelta1, &
3289  sdsdelta2
3290 #endif
3291 
3292 #ifdef W3_ST4
3293  WRITE (ndso,2924) sdsbchoice, sdsc2, sdscum, sdsc4, &
3294  sdsc5, sdsc6, &
3295  wnmeanp, fxpm3, fxfm3, fxfmage, &
3296  sdsbint, sdsbck, sdsabk, sdspbk, sdshck, &
3297  sdsbr, sdsstrain, sdsstraina, sdsstrain2, &
3298  sdsbt, sdsp, sdsiso, sdscos, sdsdth, sdsbrf1, &
3299  sdsbrfdf, sdsbm0, sdsbm1, sdsbm2, sdsbm3, sdsbm4, &
3300  spmss, sdkof, sdsmwd, sdsfacmtf, sdsnmtf,sdsmwpow,&
3301  sdscump, cumsigp, sdsnuw, whitecapwidth, whitecapdur
3302 #endif
3303 #ifdef W3_ST6
3304  WRITE (ndso,2924) sdset, sdsa1, sdsa2, sdsp1, sdsp2
3305  WRITE (ndso,2937) swlb1, cstb1
3306 #endif
3307 #ifdef W3_BT1
3308  WRITE (ndso,2926) gamma
3309 #endif
3310 #ifdef W3_BT4
3311  WRITE (ndso,2926) sedmapd50, sed_d50_uniform, &
3312  ripfac1,ripfac2,ripfac3,ripfac4, sigdepth, &
3313  botroughmin, botroughfac
3314 #endif
3315 #ifdef W3_DB1
3316  IF ( bjflag ) THEN
3317  WRITE (ndso,2928) bjalfa, bjgam, '.TRUE.'
3318  ELSE
3319  WRITE (ndso,2928) bjalfa, bjgam, '.FALSE.'
3320  END IF
3321 #endif
3322 #ifdef W3_PR1
3323  WRITE (ndso,2953) cfltm
3324 #endif
3325 #ifdef W3_PR2
3326  WRITE (ndso,2953) cfltm, dtime, latmin
3327 #endif
3328 #ifdef W3_SMC
3329  WRITE (ndso,2954) cflsm, dtims, arctic, rfmaxd, uno3, &
3330  averg, lvsmc, nbismc, ishft, jeqt, seawnd
3331 #endif
3332 #ifdef W3_PR3
3333  WRITE (ndso,2953) cfltm, wdthcg, wdthth
3334 #endif
3335  !
3336  WRITE (ndso,2956) ugbccfl, ugobcauto, ugobcdepth,trim(ugobcfile), &
3337  expfsn, expfspsi, expfsfct, impfsn, exptotal,&
3338  imptotal, imprefraction, impfreqshift, &
3339  impsource, setup_apply_wlv, &
3340  jgs_terminate_maxiter, &
3341  jgs_terminate_difference, &
3342  jgs_terminate_norm, &
3343  jgs_limiter, &
3344  jgs_limiter_func, &
3345  jgs_use_jacobi, &
3346  jgs_block_gauss_seidel, &
3347  jgs_maxiter, &
3348  jgs_pmin, &
3349  jgs_diff_thr, &
3350  jgs_norm_thr, &
3351  jgs_nlevel, &
3352  jgs_source_nonlinear
3353  !
3354  WRITE (ndso,2976) p2sf, i1p2sf, i2p2sf, &
3355  us3d, i1us3d, i2us3d, &
3356  ussp, iussp, &
3357  e3d, i1e3d, i2e3d, &
3358  th1mf, i1th1m, i2th1m, &
3359  sth1mf, i1sth1m, i2sth1m, &
3360  th2mf, i1th2m, i2th2m, &
3361  sth2mf, i1sth2m, i2sth2m
3362  !
3363 #ifdef W3_REF1
3364  WRITE(ndso,2986) refcoast, reffreq, refslope, refmap, &
3365  refmapd, refsubgrid , refrmax, reffreqpow, &
3366  reficeberg, refcosp_straight, refunstsource
3367 #endif
3368  !
3369 #ifdef W3_IG1
3370  WRITE(ndso,2977) igmethod, igaddoutp, igsource, &
3371  igsterms, igbcoverwrite, igswellmax, &
3372  igmaxfreq, igsourceatbp, igkdmin, &
3373  igfixeddepth, igempirical
3374 #endif
3375  !
3376 #ifdef W3_IC2
3377  WRITE(ndso,2978) ic2disper, ic2turb, ic2rough, &
3378  ic2reynolds, ic2smooth, ic2visc, ic2turbs, &
3379  ic2dmax
3380 #endif
3381  !
3382 #ifdef W3_IC3
3383  WRITE(ndso,2979) ic3maxthk, ic3maxcnc, ic2turb, &
3384  ic2rough, ic2reynolds, ic2smooth, &
3385  ic2visc, ic2turbs, ic3cheng, &
3386  usecgice, ic3hilim, ic3kilim, &
3387  ic3hice, ic3visc, ic3dens, ic3elas
3388 #endif
3389  !
3390 #ifdef W3_IC4
3391  WRITE(ndso,nml=sic4)
3392 #endif
3393  !
3394 #ifdef W3_IC5
3395  WRITE(ndso,2981) ic5minig, ic5minwt, ic5maxkratio, &
3396  ic5maxki, ic5minhw, ic5maxiter, &
3397  ic5rkick, ic5kfilter, ic5vemod
3398 #endif
3399  !
3400 #ifdef W3_IS1
3401  WRITE (ndso,2946) is1c1, is1c2
3402 #endif
3403  !
3404 #ifdef W3_IS2
3405  WRITE (ndso,948) isc1, is2backscat, is2isoscat, is2break, &
3406  is2dupdate, is2flexstr, is2disp, is2damp, is2fragility, is2dmin, is2c2, &
3407  is2c3, is2conc, is2creepb, is2creepc, is2creepd, &
3408  is2creepn, is2breake, is2breakf, is2wim1, is2andisb, &
3409  is2andise, is2andisd, is2andisn
3410 #endif
3411  !
3412 #ifdef W3_UOST
3413  WRITE (ndso, 4502) adjustl(trim(uostfilelocal)), adjustl(trim(uostfileshadow)), &
3414  uostfactorlocal, uostfactorshadow
3415 #endif
3416 
3417  !
3418  IF ( flcomb ) THEN
3419  WRITE (ndso,2966) cice0, cicen, lice, pmove, xseed, flagtr, &
3420  xp, xr, xfilt, ihmax, hspmin, wsmult, &
3421  wscut, '.TRUE.', noswll, fhmax, &
3422  rwndc, wcor1, wcor2, facberg, gshift, &
3423  stdx, stdy, stdt, icehmin, icehfac, &
3424  icehinit, icedisp, icehdisp, &
3425  icesln, icewind, icesnl, icesds, &
3426  iceddisp,icefdisp, caltype, trckcmpr, &
3427  btbeta
3428  ELSE
3429  WRITE (ndso,2966) cice0, cicen, lice, pmove, xseed, flagtr, &
3430  xp, xr, xfilt, ihmax, hspmin, wsmult, &
3431  wscut, '.FALSE.', noswll, fhmax, &
3432  rwndc, wcor1, wcor2, facberg, gshift, &
3433  stdx, stdy, stdt, icehmin, icehfac, &
3434  icehinit, icedisp, icehdisp, &
3435  icesln, icewind, icesnl, icesds, &
3436  iceddisp, icefdisp, caltype, trckcmpr,&
3437  btbeta
3438  END IF
3439  !
3440 #ifdef W3_FLD1
3441  WRITE(ndso,2987) tail_id, tail_lev, tail_tran1, tail_tran2
3442 #endif
3443 #ifdef W3_FLD2
3444  WRITE(ndso,2987) tail_id, tail_lev, tail_tran1, tail_tran2
3445 #endif
3446 #ifdef W3_RTD
3447  WRITE(ndso,4991) plat, plon, unrot
3448  WRITE(ndso,4992) bplat, bplon
3449 #endif
3450  !
3451  WRITE (ndso,918)
3452  END IF
3453  !
3454  ! 6.p Set various other values ...
3455  ! ... Tail in integration --> scale factor for A to E conv
3456  !
3457  fte = 0.25 * sig(nk) * dth * sig(nk)
3458  ftf = 0.20 * dth * sig(nk)
3459  ftwn = 0.20 * sqrt(grav) * dth * sig(nk)
3460  fttr = ftf
3461  ftwl = grav / 6. / sig(nk) * dth * sig(nk)
3462 #ifdef W3_ST3
3463  stxftf = 1/(fachf-1.-wnmeanp*2) &
3464  * sig(nk)**(2+wnmeanp*2) * dth
3465  stxftftail = 1/(fachf-1.-wnmeanptail*2) &
3466  * sig(nk)**(2+wnmeanptail*2) * dth
3467  stxftwn = 1/(fachf-1.-wnmeanp*2) * sig(nk)**(2) &
3468  * (sig(nk)/sqrt(grav))**(wnmeanp*2) * dth
3469  sstxftf = stxftf
3470  sstxftftail = stxftftail
3471  sstxftwn = stxftwn
3472 #endif
3473  !
3474 #ifdef W3_ST4
3475  stxftf = 1/(fachf-1.-wnmeanp*2) &
3476  * sig(nk)**(2+wnmeanp*2) * dth
3477  stxftftail = 1/(fachf-1.-wnmeanptail*2) &
3478  * sig(nk)**(2+wnmeanptail*2) * dth
3479  stxftwn = 1/(fachf-1.-wnmeanp*2) * sig(nk)**(2) &
3480  * (sig(nk)/sqrt(grav))**(wnmeanp*2) * dth
3481  sstxftf = stxftf
3482  sstxftftail = stxftftail
3483  sstxftwn = stxftwn
3484 #endif
3485  !
3486  ! ... High frequency cut-off
3487  !
3488  fxfm = 2.5
3489 #ifdef W3_ST6
3490  fxfm = sin6fc
3491 #endif
3492  fxpm = 4.0
3493  fxpm = fxpm * grav / 28.
3494  fxfm = fxfm * tpi
3495  xfc = 3.0
3496 #ifdef W3_ST2
3497  xfh = 2.0
3498  xf1 = 1.75
3499  xf2 = 2.5
3500  xft = xf2
3501 #endif
3502  !
3503  facti1 = 1. / log(xfr)
3504  facti2 = 1. - log(tpi*fr1) * facti1
3505  !
3506  ! Setting of FACHF moved to before !/NL2 set-up for consistency
3507  !
3508 #ifdef W3_NL2
3509  fachf = -tailnl
3510 #endif
3511  fachfa = xfr**(-fachf-2)
3512  fachfe = xfr**(-fachf)
3513  !
3514  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
3515  ! 7. Read and prepare the grid.
3516  ! 7.a Type of grid
3517  !
3518  IF (flgnml) THEN
3519  gstrg=trim(nml_grid%TYPE)
3520  IF (trim(nml_grid%COORD).EQ.'SPHE') flagll=.true.
3521  IF (trim(nml_grid%COORD).EQ.'CART') flagll=.false.
3522  cstrg=trim(nml_grid%CLOS)
3523  ELSE
3524  CALL nextln ( comstr , ndsi , ndse )
3525  READ (ndsi,*,END=2001,ERR=2002) GSTRG, FLAGLL, cstrg
3526  CALL nextln ( comstr , ndsi , ndse )
3527  END IF
3528 
3529  SELECT CASE (trim(gstrg))
3530  CASE ('RECT')
3531  gtype = rlgtype
3532  WRITE (ndso,3000) 'rectilinear'
3533  CASE ('CURV')
3534  gtype = clgtype
3535  WRITE (ndso,3000) 'curvilinear'
3536  CASE ('UNST')
3537  gtype = ungtype
3538  WRITE (ndso,3000) 'unstructured'
3539  !!Li Add SMC grid type option. JGLi12Oct2020
3540  CASE ('SMCG')
3541  gtype = smctype
3542  WRITE (ndso,3000) 'SMC Grid'
3543  CASE DEFAULT
3544  WRITE (ndse,1007) trim(gstrg)
3545  CALL extcde ( 25 )
3546  END SELECT
3547  !
3548  IF ( flagll ) THEN
3549  factor = 1.
3550  WRITE (ndso,3001) 'spherical'
3551  ELSE
3552  factor = 1.e-3
3553  WRITE (ndso,3001) 'Cartesian'
3554  END IF
3555  !
3556  ! Only process grid closure string for logically rectangular grids.
3557  ! Closure setting for unstructured grids is NONE.
3558  iclose = iclose_none
3559  IF ( gtype.NE.ungtype ) THEN
3560  SELECT CASE (trim(cstrg))
3561  CASE ('NONE')
3562  iclose = iclose_none
3563  WRITE (ndso,3002) 'none'
3564  CASE ('SMPL')
3565  iclose = iclose_smpl
3566  WRITE (ndso,3002) 'simple'
3567  CASE ('TRPL')
3568  WRITE (ndse,'(/2A)') ' *** WARNING WW3_GRID: TRIPOLE ', &
3569  'GRID CLOSURE IMPLEMENTATION IS INCOMPLETE ***'
3570  iclose = iclose_trpl
3571  WRITE (ndso,3002) 'tripole'
3572  IF ( gtype.EQ.rlgtype ) THEN
3573  WRITE (ndse,1009)
3574  CALL extcde ( 25 )
3575  END IF
3576  CASE DEFAULT
3577  ! Check for old style GLOBAL input
3578  SELECT CASE (trim(cstrg))
3579  CASE ('T','t','.TRU','.tru')
3580  iclose = iclose_smpl
3581  WRITE (ndso,3002) 'simple'
3582  WRITE (ndse,1013)
3583  CASE ('F','f','.FAL','.fal')
3584  iclose = iclose_none
3585  WRITE (ndso,3002) 'none'
3586  WRITE (ndse,1013)
3587  CASE DEFAULT
3588  WRITE (ndse,1012) trim(cstrg)
3589  CALL extcde ( 25 )
3590  END SELECT
3591  END SELECT
3592  IF ( iclose.NE.iclose_none .AND. .NOT.flagll ) THEN
3593  WRITE (ndse,1008)
3594  CALL extcde ( 25 )
3595  END IF
3596  END IF !GTYPE.NE.UNGTYPE
3597  !
3598  ! 7.b Size of grid
3599  !
3600  IF (flgnml) THEN
3601  SELECT CASE ( gtype )
3602  !!Li SMCTYPE shares domain info with RLGTYPE. JGLi12Oct2020
3603  CASE ( rlgtype, smctype )
3604  nx = nml_rect%NX
3605  ny = nml_rect%NY
3606  nx = max( 3 , nx )
3607  ny = max( 3 , ny )
3608  WRITE (ndso,3003) nx, ny
3609  CASE ( clgtype )
3610  nx = nml_curv%NX
3611  ny = nml_curv%NY
3612  nx = max( 3 , nx )
3613  ny = max( 3 , ny )
3614  WRITE (ndso,3003) nx, ny
3615  CASE ( ungtype )
3616  ny=1
3617  END SELECT
3618  ELSE
3619  IF ( gtype.NE.ungtype) THEN
3620  CALL nextln ( comstr , ndsi , ndse )
3621  READ (ndsi,*,END=2001,ERR=2002) NX, ny
3622  nx = max( 3 , nx )
3623  ny = max( 3 , ny )
3624  WRITE (ndso,3003) nx, ny
3625  ELSE
3626  ny =1
3627  END IF
3628  END IF
3629  !
3630  ! Propagation specific to unstructured grids
3631  !
3632  do_change_wlv=.false.
3633  IF ( gtype.EQ.ungtype) THEN
3634  unstschemes = 0
3635  IF (expfsn) unstschemes(1) = 1
3636  IF (expfspsi) unstschemes(2) = 1
3637  IF (expfsfct) unstschemes(3) = 1
3638  IF (impfsn) unstschemes(4) = 1
3639  IF (imptotal) unstschemes(5) = 1
3640  IF (exptotal) unstschemes(6) = 1
3641 
3642  IF (sum(unstschemes) .eq. 0) THEN
3643  WRITE(ndse,*) 'NO UNST SCHEME SELECTED'
3644  CALL extcde ( 19 )
3645  ELSE IF (sum(unstschemes) .gt. 1) THEN
3646  WRITE(ndse,*) 'MORE THAN ONE UNST SCHEME SELECTED'
3647  CALL extcde ( 19 )
3648  ENDIF
3649 
3650  unstscheme=-1
3651  DO ix=1,6
3652  IF (unstschemes(ix).EQ.1) THEN
3653  unstscheme=ix
3654  EXIT
3655  END IF
3656  END DO
3657 
3658  fsbccfl = ugbccfl
3659  SELECT CASE (unstscheme)
3660  CASE (1)
3661  fsn = expfsn
3662  pname2 = 'N Explicit (Fluctuation Splitting) '
3663  CASE (2)
3664  fspsi = expfspsi
3665  pname2 = 'PSI Explicit (Fluctuation Splitting) '
3666  CASE (3)
3667  fsfct = expfsfct
3668  pname2 = ' Flux Corrected Transport Explicit'
3669  CASE (4)
3670  fsnimp = impfsn
3671  pname2 = 'N Implicit (Fluctuation Splitting) '
3672  CASE (5)
3673  fstotalimp = imptotal
3674  pname2 = 'N Implicit (Fluctuation Splitting) for total implicit'
3675  CASE (6)
3676  fstotalexp = exptotal
3677  pname2 = 'N Explicit (Fluctuation Splitting) for one exchange explicit DC HPCF '
3678  END SELECT
3679 
3680  IF (fstotalimp .or. fstotalexp) THEN
3681  lpdlib = .true.
3682  ENDIF
3683  !
3684  IF (sum(unstschemes).GT.1) WRITE(ndso,1035)
3685  WRITE (ndso,2951) pname2
3686 
3687 
3688  IF (imprefraction .and. imptotal .AND. flcth) THEN
3689  fsrefraction = .true.
3690  pname2 = 'Refraction done implicitly'
3691  WRITE (ndso,2951) pname2
3692  ELSE
3693  fsrefraction = .false.
3694  END IF
3695  IF (impfreqshift .and. imptotal .AND. flck) THEN
3696  fsfreqshift = .true.
3697  pname2 = 'Frequency shifting done implicitly'
3698  WRITE (ndso,2951) pname2
3699  ELSE
3700  fsfreqshift = .false.
3701  END IF
3702  IF (impsource .and. imptotal .AND. flsou) THEN
3703  fssource = .true.
3704  pname2 = 'Source terms integrated implicitly'
3705  WRITE (ndso,2951) pname2
3706  ELSE
3707  fssource = .false.
3708  END IF
3709  IF (setup_apply_wlv) THEN
3710  do_change_wlv = setup_apply_wlv
3711  pname2 = 'Wave setup is added to the WLV'
3712  WRITE (ndso,2952) pname2
3713  END IF
3714  solverthr_stp = solverthr_setup
3715  crit_dep_stp = crit_dep_setup
3716  END IF
3717 
3718  !
3719  ! 7.c Grid coordinates (branch here based on grid type)
3720  !
3721  IF ( gtype.NE.ungtype) ALLOCATE ( xgrdin(nx,ny), ygrdin(nx,ny) )
3722  SELECT CASE ( gtype )
3723  !
3724  ! 7.c.1 Rectilinear grid
3725  !
3726  !!Li SMC grid shares domain info with RLGTYPE. JGLi12Oct2020
3727  CASE ( rlgtype, smctype )
3728  !
3729  IF (flgnml) THEN
3730  sx = nml_rect%SX
3731  sy = nml_rect%SY
3732  vsc = nml_rect%SF
3733  x0 = nml_rect%X0
3734  y0 = nml_rect%Y0
3735  vsc0 = nml_rect%SF0
3736  ELSE
3737  CALL nextln ( comstr , ndsi , ndse )
3738  READ (ndsi,*,END=2001,ERR=2002) SX, SY, vsc
3739  CALL nextln ( comstr , ndsi , ndse )
3740  READ (ndsi,*,END=2001,ERR=2002) X0, Y0, vsc0
3741  END IF
3742  !
3743  vsc = max( 1.e-7 , vsc )
3744  sx = sx / vsc
3745  sy = sy / vsc
3746  sx = max( 1.e-7 , sx )
3747  sy = max( 1.e-7 , sy )
3748  IF ( iclose.EQ.iclose_smpl ) sx = 360. / real(nx)
3749  !
3750  vsc0 = max( 1.e-7 , vsc0 )
3751  x0 = x0 / vsc0
3752  y0 = y0 / vsc0
3753  !
3754  IF ( flagll ) THEN
3755  WRITE (ndso,3004) factor*sx, factor*sy, &
3756  factor*x0, factor*(x0+real(nx-1)*sx), &
3757  factor*y0, factor*(y0+real(ny-1)*sy)
3758  ELSE
3759  WRITE (ndso,3005) factor*sx, factor*sy, &
3760  factor*x0, factor*(x0+real(nx-1)*sx), &
3761  factor*y0, factor*(y0+real(ny-1)*sy)
3762  END IF
3763  !
3764  DO iy=1, ny
3765  DO ix=1, nx
3766  xgrdin(ix,iy) = x0 + real(ix-1)*sx
3767  ygrdin(ix,iy) = y0 + real(iy-1)*sy
3768  END DO
3769  END DO
3770  !
3771  ! 7.c.2 Curvilinear grid
3772  !
3773  CASE ( clgtype )
3774  !
3775  ! 7.c.2.a Process x-coordinates
3776  !
3777  IF (flgnml) THEN
3778  ndsg = nml_curv%XCOORD%IDF
3779  vsc = nml_curv%XCOORD%SF
3780  vof = nml_curv%XCOORD%OFF
3781  idla = nml_curv%XCOORD%IDLA
3782  idfm = nml_curv%XCOORD%IDFM
3783  rform = trim(nml_curv%XCOORD%FORMAT)
3784  from = trim(nml_curv%XCOORD%FROM)
3785  fname = trim(nml_curv%XCOORD%FILENAME)
3786  ELSE
3787  CALL nextln ( comstr , ndsi , ndse )
3788  READ (ndsi,*,END=2001,ERR=2002) NDSG, VSC, VOF, &
3789  idla, idfm, rform, from, fname
3790  END IF
3791  !
3792  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
3793  IF (idfm.LT.1 .OR. idfm.GT.3) idfm = 1
3794  !
3795  WRITE (ndso,3006) ndsg, vsc, vof, idla, idfm
3796  IF (idfm.EQ.2) WRITE (ndso,3008) trim(rform)
3797  IF (from.EQ.'NAME' .AND. ndsg.NE.ndsi) &
3798  WRITE (ndso,3009) trim(fname)
3799  !
3800  IF ( ndsg .EQ. ndsi ) THEN
3801  IF ( idfm .EQ. 3 ) THEN
3802  WRITE (ndse,1004) ndsg
3803  CALL extcde (23)
3804  ELSE
3805  IF (.NOT.flgnml) THEN
3806  CALL nextln ( comstr , ndsi , ndse )
3807  END IF
3808  END IF
3809  ELSE
3810  IF ( idfm .EQ. 3 ) THEN
3811  IF (from.EQ.'NAME') THEN
3812  OPEN (ndsg,file=trim(fnmpre)//trim(fname),&
3813  form='UNFORMATTED', convert=file_endian, &
3814  status='OLD',err=2000,iostat=ierr)
3815  ELSE
3816  OPEN (ndsg, &
3817  form='UNFORMATTED', convert=file_endian, &
3818  status='OLD',err=2000,iostat=ierr)
3819  END IF
3820  ELSE
3821  IF (from.EQ.'NAME') THEN
3822  OPEN (ndsg,file=trim(fnmpre)//trim(fname),&
3823  status='OLD',err=2000,iostat=ierr)
3824  ELSE
3825  OPEN (ndsg, &
3826  status='OLD',err=2000,iostat=ierr)
3827  END IF
3828  END IF !IDFM
3829  END IF !NDSG
3830  !
3831  CALL ina2r ( xgrdin, nx, ny, 1, nx, 1, ny, ndsg, ndst, ndse, &
3832  idfm, rform, idla, vsc, vof)
3833  !
3834  ! 7.c.2.b Process y-coordinates
3835  !
3836  IF (flgnml) THEN
3837  ndsg = nml_curv%YCOORD%IDF
3838  vsc = nml_curv%YCOORD%SF
3839  vof = nml_curv%YCOORD%OFF
3840  idla = nml_curv%YCOORD%IDLA
3841  idfm = nml_curv%YCOORD%IDFM
3842  rform = trim(nml_curv%YCOORD%FORMAT)
3843  from = trim(nml_curv%YCOORD%FROM)
3844  fname = trim(nml_curv%YCOORD%FILENAME)
3845  ELSE
3846  CALL nextln ( comstr , ndsi , ndse )
3847  READ (ndsi,*,END=2001,ERR=2002) NDSG, VSC, VOF, &
3848  idla, idfm, rform, from, fname
3849  END IF
3850  !
3851  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
3852  IF (idfm.LT.1 .OR. idfm.GT.3) idfm = 1
3853  !
3854  WRITE (ndso,3007) ndsg, vsc, vof, idla, idfm
3855  IF (idfm.EQ.2) WRITE (ndso,3008) trim(rform)
3856  IF (from.EQ.'NAME' .AND. ndsg.NE.ndsi) &
3857  WRITE (ndso,3009) trim(fname)
3858  !
3859  IF ( ndsg .EQ. ndsi ) THEN
3860  IF ( idfm .EQ. 3 ) THEN
3861  WRITE (ndse,1004) ndsg
3862  CALL extcde (23)
3863  ELSE
3864  IF (.NOT.flgnml) THEN
3865  CALL nextln ( comstr , ndsi , ndse )
3866  END IF
3867  END IF
3868  ELSE
3869  IF ( idfm .EQ. 3 ) THEN
3870  IF (from.EQ.'NAME') THEN
3871  OPEN (ndsg,file=trim(fnmpre)//trim(fname),&
3872  form='UNFORMATTED', convert=file_endian, &
3873  status='OLD',err=2000,iostat=ierr)
3874  ELSE
3875  OPEN (ndsg, &
3876  form='UNFORMATTED', convert=file_endian, &
3877  status='OLD',err=2000,iostat=ierr)
3878  END IF
3879  ELSE
3880  IF (from.EQ.'NAME') THEN
3881  OPEN (ndsg,file=trim(fnmpre)//trim(fname),&
3882  status='OLD',err=2000,iostat=ierr)
3883  ELSE
3884  OPEN (ndsg, &
3885  status='OLD',err=2000,iostat=ierr)
3886  END IF
3887  END IF !IDFM
3888  END IF !NDSG
3889  !
3890  CALL ina2r ( ygrdin, nx, ny, 1, nx, 1, ny, ndsg, ndst, ndse, &
3891  idfm, rform, idla, vsc, vof)
3892  !
3893  ! 7.c.2.c Check for obvious errors in grid definition or input
3894  !
3895  ! ....... Check for inverted grid (can result from wrong IDLA)
3896  IF ( (xgrdin(2,1)-xgrdin(1,1))*(ygrdin(1,2)-ygrdin(1,1)) .LT. &
3897  (ygrdin(2,1)-ygrdin(1,1))*(xgrdin(1,2)-xgrdin(1,1)) ) THEN
3898  WRITE (ndse,1011) idla
3899  !.........Notes: here, we are checking to make sure that the j axis is ~90 degrees
3900  !................counter-clockwise from the i axis (the standard cartesian setup).
3901  !................So, it is a check on the handedness of the grid.
3902  !................We have confirmed for one case that a left-handed grid produces
3903  !................errors in SCRIP. We have not confirmed that left-handed grids necessarily
3904  !................produce errors in single-grid simulations, or that they necessarily
3905  !................produce errors in all multi-grid simulations.
3906  !................Note that transposing or flipping a grid will generally change the handedness.
3907  CALL extcde (25)
3908  END IF
3909  !
3910  ! 7.c.3 Unstructured grid
3911  !
3912  CASE ( ungtype )
3913  !
3914  maxx = 0.
3915  maxy = 0.
3916  dxymax = 0.
3917  WRITE (ndso,1150)
3918 
3919  IF (flgnml) THEN
3920  zlim = nml_grid%ZLIM
3921  dmin = nml_grid%DMIN
3922  ndsg = nml_unst%IDF
3923  vsc = nml_unst%SF
3924  idla = nml_unst%IDLA
3925  idfm = nml_unst%IDFM
3926  rform = trim(nml_unst%FORMAT)
3927  from = 'NAME'
3928  fname = trim(nml_unst%FILENAME)
3929  ugobcfile = trim(nml_unst%UGOBCFILE)
3930  END IF
3931  END SELECT !GTYPE
3932  !
3933  ! 7.d Depth information for grid
3934  !
3935  IF (flgnml) THEN
3936  IF (gtype.NE.ungtype) THEN
3937  zlim = nml_grid%ZLIM
3938  dmin = nml_grid%DMIN
3939  ndsg = nml_depth%IDF
3940  vsc = nml_depth%SF
3941  idla = nml_depth%IDLA
3942  idfm = nml_depth%IDFM
3943  rform = trim(nml_depth%FORMAT)
3944  from = trim(nml_depth%FROM)
3945  fname = trim(nml_depth%FILENAME)
3946  END IF
3947  ELSE
3948  CALL nextln ( comstr , ndsi , ndse )
3949  READ (ndsi,*,END=2001,ERR=2002) ZLIM, DMIN, NDSG, VSC, IDLA, &
3950  idfm, rform, from, fname
3951  END IF
3952  !
3953  dmin = max( 1.e-3 , dmin )
3954  IF ( abs(vsc) .LT. 1.e-7 ) vsc = 1.
3955  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
3956  IF (idfm.LT.1 .OR. idfm.GT.3) idfm = 1
3957  !
3958  WRITE (ndso,972) ndsg, zlim, dmin, vsc, idla, idfm
3959  IF (idfm.EQ.2) WRITE (ndso,973) trim(rform)
3960  IF (from.EQ.'NAME' .AND. ndsg.NE.ndsi) &
3961  WRITE (ndso,974) trim(fname)
3962 
3963 #ifdef W3_SMC
3964  !Li Save the depth conversion factor for SMC grid use. JGLi03Nov2023
3965  dvsmc = vsc
3966 #endif
3967 
3968  !
3969  ! 7.e Read bottom depths
3970  !
3971  IF ( gtype.NE.ungtype ) THEN
3972  !
3973  ! Reading depths on structured grid
3974  !
3975  ALLOCATE ( zbin(nx,ny), obsx(nx,ny), obsy(nx,ny) )
3976  !
3977  ! Initialize subgrid obstructions with zeros.
3978  zbin(:,:)=0.
3979  obsx(:,:)=0.
3980  obsy(:,:)=0.
3981 
3982  !Li Suspended for SMC grid, which uses depth stored in its cell array.
3983  !Li JGLi15Oct2014
3984  IF( gtype .NE. smctype ) THEN
3985  !
3986  IF ( ndsg .EQ. ndsi ) THEN
3987  IF ( idfm .EQ. 3 ) THEN
3988  WRITE (ndse,1004) ndsg
3989  CALL extcde (23)
3990  ELSE
3991  CALL nextln ( comstr , ndsi , ndse )
3992  END IF
3993  ELSE ! NDSG.NE.NDSI
3994  IF ( idfm .EQ. 3 ) THEN
3995  IF (from.EQ.'NAME') THEN
3996  OPEN (ndsg,file=trim(fnmpre)//trim(fname), &
3997  form='UNFORMATTED', convert=file_endian,&
3998  status='OLD',err=2000,iostat=ierr)
3999  ELSE
4000  OPEN (ndsg, form='UNFORMATTED', convert=file_endian, &
4001  status='OLD',err=2000,iostat=ierr)
4002  END IF
4003  ELSE
4004  IF (from.EQ.'NAME') THEN
4005  OPEN (ndsg,file=trim(fnmpre)//trim(fname), &
4006  status='OLD',err=2000,iostat=ierr)
4007  ELSE
4008  OPEN (ndsg, &
4009  status='OLD',err=2000,iostat=ierr)
4010  END IF
4011  END IF
4012  END IF !( NDSG .EQ. NDSI )
4013  !
4014  CALL ina2r ( zbin, nx, ny, 1, nx, 1, ny, ndsg, ndst, ndse, &
4015  idfm, rform, idla, vsc, 0.0)
4016  !
4017  !Li End of IF( GTYPE .NE. SMCTYPE ) block
4018  ENDIF
4019  !
4020  ELSE
4021  !
4022  ! Reading depths on unstructured grid (this also sets number of mesh points, NX)
4023  !
4024  CALL readmsh(ndsg,fname)
4025  ALLOCATE(zbin(nx, ny),obsx(nx,ny),obsy(nx,ny))
4026  zbin(:,1) = vsc * zb(:)
4027  !
4028  ! subgrid obstructions are not yet handled in unstructured grids
4029  !
4030  obsx(:,:)=0.
4031  obsy(:,:)=0.
4032 
4033  END IF
4034  !
4035  ! 7.f Set up temporary map
4036  !
4037  ALLOCATE ( tmpsta(ny,nx), tmpmap(ny,nx) )
4038  tmpsta = 0
4039  !
4040  IF (gtype .EQ. ungtype) THEN
4041  tmpsta = 1
4042  ELSE
4043  DO iy=1, ny
4044  DO ix=1, nx
4045  IF ( zbin(ix,iy) .LE. zlim ) tmpsta(iy,ix) = 1
4046  END DO
4047  END DO
4048  ENDIF
4049  !
4050  !Li Suspended for SMC grid. JGLi15Oct2014
4051  IF( gtype .NE. smctype ) THEN
4052  !
4053  ! 7.g Subgrid information
4054  !
4055  trflag = flagtr
4056  IF ( trflag.GT.6 .OR. trflag.LT.0 ) trflag = 0
4057  !
4058  IF ( trflag .EQ. 0 ) THEN
4059  WRITE (ndso,976) 'Not available.'
4060  ELSE IF ( trflag.EQ.1 .OR. trflag.EQ.3 .OR. trflag.EQ.5 ) THEN
4061  WRITE (ndso,976) 'In between grid points.'
4062  ELSE
4063  WRITE (ndso,976) 'At grid points.'
4064  END IF
4065  !
4066  IF ( trflag .NE. 0 ) THEN
4067  !
4068  ! 7.g.1 Info from input file
4069  !
4070  IF (flgnml) THEN
4071  ndstr = nml_obst%IDF
4072  vsc = nml_obst%SF
4073  idla = nml_obst%IDLA
4074  idft = nml_obst%IDFM
4075  rform = trim(nml_obst%FORMAT)
4076  from = trim(nml_obst%FROM)
4077  tname = trim(nml_obst%FILENAME)
4078  ELSE
4079  CALL nextln ( comstr , ndsi , ndse )
4080  READ (ndsi,*,END=2001,ERR=2002) NDSTR, VSC, IDLA, IDFT, RFORM, &
4081  from, tname
4082  END IF
4083  !
4084  IF ( abs(vsc) .LT. 1.e-7 ) vsc = 1.
4085  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
4086  IF (idft.LT.1 .OR. idft.GT.3) idft = 1
4087  !
4088  WRITE (ndso,977) ndstr, vsc, idla, idft
4089  IF (idft.EQ.2) WRITE (ndso,973) rform
4090  IF (from.EQ.'NAME' .AND. ndsg.NE.ndstr) WRITE (ndso,974) tname
4091  !
4092  ! 7.g.2 Open file and check if necessary
4093  !
4094  IF ( ndstr .EQ. ndsi ) THEN
4095  IF ( idft .EQ. 3 ) THEN
4096  WRITE (ndse,1004) ndstr
4097  CALL extcde (23)
4098  ELSE
4099  CALL nextln ( comstr , ndsi , ndse )
4100  END IF
4101  ELSE IF ( ndstr .EQ. ndsg ) THEN
4102  IF ( ( idfm.EQ.3 .AND. idft.NE.3 ) .OR. &
4103  ( idfm.NE.3 .AND. idft.EQ.3 ) ) THEN
4104  WRITE (ndse,1005) idfm, idft
4105  CALL extcde (24)
4106  END IF
4107  ELSE
4108  IF ( idft .EQ. 3 ) THEN
4109  IF (from.EQ.'NAME') THEN
4110  OPEN (ndstr,file=trim(fnmpre)//tname, &
4111  form='UNFORMATTED', convert=file_endian,status='OLD',err=2000, &
4112  iostat=ierr)
4113  ELSE
4114  OPEN (ndstr, form='UNFORMATTED', convert=file_endian, &
4115  status='OLD',err=2000,iostat=ierr)
4116  END IF
4117  ELSE
4118  IF (from.EQ.'NAME') THEN
4119  OPEN (ndstr,file=trim(fnmpre)//tname, &
4120  status='OLD',err=2000,iostat=ierr)
4121  ELSE
4122  OPEN (ndstr, &
4123  status='OLD',err=2000,iostat=ierr)
4124  END IF
4125  END IF
4126  END IF
4127  !
4128  ! 7.g.3 Read the data
4129  !
4130  CALL ina2r ( obsx, nx, ny, 1, nx, 1, ny, ndstr, ndst, ndse, &
4131  idft, rform, idla, vsc, 0.0)
4132  !
4133  IF ( ndstr .EQ. ndsi ) CALL nextln ( comstr , ndsi , ndse )
4134  !
4135  CALL ina2r ( obsy, nx, ny, 1, nx, 1, ny, ndstr, ndst, ndse, &
4136  idft, rform, idla, vsc, 0.0)
4137  !
4138  ! 7.g.4 Limit
4139  !
4140  DO ix=1, nx
4141  DO iy=1, ny
4142  obsx(ix,iy) = max( 0. , min(1.,obsx(ix,iy)) )
4143  obsy(ix,iy) = max( 0. , min(1.,obsy(ix,iy)) )
4144  END DO
4145  END DO
4146  !
4147  WRITE (ndso,*)
4148  !
4149  END IF ! TRFLAG
4150  !
4151  !Li End of IF( GTYPE .NE. SMCTYPE ) block
4152  END IF
4153  !
4154 #ifdef W3_RTD
4155  ! 7.h Calculate rotation angles for configs with rotated pole
4156  polon = plon
4157  polat = plat
4158  flagunr = unrot
4159  ! Default values PLON=-180, PLAT=90, UNROT=.FALSE. for standard lat-lon
4160 
4161  ALLOCATE( angldin(nx,ny) )
4162  ! For standard lat-lon the rotation angles are zero
4163  IF ( polat == 90. ) THEN
4164  angldin = 0.
4165  ELSE
4166  ALLOCATE(stdlat(nx,ny), stdlon(nx,ny))
4167 
4168  ! Calculate rotation angles; (StdLon/Lat are returned, but not used)
4169  ! The regular grid X/YGRDIN are used as equatorial lon and lat
4170  CALL w3eqtoll( ygrdin, xgrdin, stdlat, stdlon, angldin, &
4171  polat, polon, nx*ny )
4172 
4173  ! Clean up
4174  DEALLOCATE( stdlat, stdlon )
4175  END IF
4176  ! Write out rotation information
4177  WRITE (ndso,4203) polat, polon
4178  WRITE (ndso,4200)
4179  WRITE (ndso,4201) ( ix, ix=1,nx,nx/3)
4180  WRITE (ndso,4202) 1,(angldin(ix, 1), ix=1,nx,nx/3)
4181  WRITE (ndso,4202) ny,(angldin(ix,ny), ix=1,nx,nx/3)
4182  IF ( flagunr ) WRITE (ndso,4204)
4183  WRITE (ndso,*) ' '
4184 
4185 #endif
4186  !
4187 #ifdef W3_SMC
4188  !! 7.i Read SMC grid cell and face integer arrays.
4189  IF( gtype .EQ. smctype ) THEN
4190 
4191  !! Overwrite 2 parameters for SMC grid. JGLi03Mar2021
4192  dtms = dtims
4193  ctmax = cflsm
4194  !
4195  IF (flgnml) THEN
4196  ndstr = nml_smc%MCELS%IDF
4197  idla = nml_smc%MCELS%IDLA
4198  idfm = nml_smc%MCELS%IDFM
4199  rform = trim(nml_smc%MCELS%FORMAT)
4200  tname = trim(nml_smc%MCELS%FILENAME)
4201  ELSE
4202  CALL nextln ( comstr , ndsi , ndse )
4203  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4204  END IF
4205  OPEN (ndstr,file=trim(fnmpre)//tname, &
4206  form='FORMATTED',status='OLD',err=2000)
4207  ALLOCATE ( nlvcelsk( 0:nrlv ) )
4208  READ (ndstr,*) nlvcelsk
4209  ncel=nlvcelsk(0)
4210  nglo=ncel
4211  WRITE (ndso,4004) ncel, nlvcelsk
4212 
4213  ALLOCATE ( ijkcelin( 5, ncel))
4214  CALL ina2i ( ijkcelin, 5, ncel, 1, 5, 1, ncel, ndstr, ndst, ndse, &
4215  idfm, rform, idla, 1, 0)
4216  CLOSE(ndstr)
4217  !!Li Offset to change Equator index = 0 to regular grid index JEQT
4218  ijkcelin( 2, :) = ijkcelin( 2, :) + jeqt
4219  !!Li Offset to change i-index = 0 to regular grid index ISHFT
4220  ijkcelin( 1, :) = ijkcelin( 1, :) + ishft
4221 
4222  WRITE (ndso,4005) tname
4223  WRITE (ndso,4006) 1,(ijkcelin(ix, 1), ix=1,5)
4224  WRITE (ndso,4006) ncel,(ijkcelin(ix, ncel), ix=1,5)
4225  WRITE (ndso,*) ' '
4226 
4227  IF (flgnml) THEN
4228  ndstr = nml_smc%ISIDE%IDF
4229  idla = nml_smc%ISIDE%IDLA
4230  idfm = nml_smc%ISIDE%IDFM
4231  rform = trim(nml_smc%ISIDE%FORMAT)
4232  tname = trim(nml_smc%ISIDE%FILENAME)
4233  ELSE
4234  CALL nextln ( comstr , ndsi , ndse )
4235  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4236  END IF
4237  OPEN (ndstr,file=trim(fnmpre)//tname, &
4238  form='FORMATTED',status='OLD',err=2000)
4239  ALLOCATE ( nlvufcsk( 0:nrlv ) )
4240  READ (ndstr,*) nlvufcsk
4241  nufc = nlvufcsk(0)
4242  ngui = nufc
4243  WRITE (ndso,4007) nufc, nlvufcsk
4244 
4245  ALLOCATE ( ijkufcin( 7, nufc) )
4246  CALL ina2i ( ijkufcin, 7, nufc, 1, 7, 1, nufc, ndstr, ndst, ndse, &
4247  idfm, rform, idla, 1, 0)
4248  CLOSE(ndstr)
4249  !!Li Offset to change Equator index = 0 to regular grid index
4250  ijkufcin( 2, :) = ijkufcin( 2, :) + jeqt
4251  ijkufcin( 1, :) = ijkufcin( 1, :) + ishft
4252 
4253  WRITE (ndso,4008) tname
4254  WRITE (ndso,4009) 1,(ijkufcin(ix, 1), ix=1,7)
4255  WRITE (ndso,4009) nufc,(ijkufcin(ix, nufc), ix=1,7)
4256  WRITE (ndso,*) ' '
4257 
4258  IF (flgnml) THEN
4259  ndstr = nml_smc%JSIDE%IDF
4260  idla = nml_smc%JSIDE%IDLA
4261  idfm = nml_smc%JSIDE%IDFM
4262  rform = trim(nml_smc%JSIDE%FORMAT)
4263  tname = trim(nml_smc%JSIDE%FILENAME)
4264  ELSE
4265  CALL nextln ( comstr , ndsi , ndse )
4266  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4267  END IF
4268  OPEN (ndstr,file=trim(fnmpre)//tname, &
4269  form='FORMATTED',status='OLD',err=2000)
4270  ALLOCATE ( nlvvfcsk( 0:nrlv ) )
4271  READ (ndstr,*) nlvvfcsk
4272  nvfc= nlvvfcsk(0)
4273  ngvj= nvfc
4274  WRITE (ndso,4010) nvfc, nlvvfcsk
4275 
4276  ALLOCATE ( ijkvfcin( 8, nvfc) )
4277  CALL ina2i ( ijkvfcin, 8, nvfc, 1, 8, 1, nvfc, ndstr, ndst, ndse, &
4278  idfm, rform, idla, 1, 0)
4279  CLOSE(ndstr)
4280  !!Li Offset to change Equator index = 0 to regular grid index
4281  ijkvfcin( 2, :) = ijkvfcin( 2, :) + jeqt
4282  ijkvfcin( 1, :) = ijkvfcin( 1, :) + ishft
4283 
4284  WRITE (ndso,4011) tname
4285  WRITE (ndso,4012) 1,(ijkvfcin(ix, 1), ix=1,8)
4286  WRITE (ndso,4012) nvfc,(ijkvfcin(ix, nvfc), ix=1,8)
4287  WRITE (ndso,*) ' '
4288 
4289  !!Li Subgrid obstruction for each SMCels. JGLi15Oct2014
4290  IF (flgnml) THEN
4291  ndstr = nml_smc%SUBTR%IDF
4292  idla = nml_smc%SUBTR%IDLA
4293  idfm = nml_smc%SUBTR%IDFM
4294  rform = trim(nml_smc%SUBTR%FORMAT)
4295  tname = trim(nml_smc%SUBTR%FILENAME)
4296  ELSE
4297  CALL nextln ( comstr , ndsi , ndse )
4298  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4299  END IF
4300  OPEN (ndstr,file=trim(fnmpre)//tname, &
4301  form='FORMATTED',status='OLD',err=2000)
4302  READ (ndstr,*) ncobst, jobs
4303  WRITE (ndso,4110) ncobst, jobs
4304 
4305  ALLOCATE ( ijkobstr( jobs, ncobst) )
4306  CALL ina2i ( ijkobstr, jobs, ncobst, 1, jobs, 1, ncobst, ndstr, ndst, &
4307  ndse, idfm, rform, idla, 1, 0)
4308  CLOSE(ndstr)
4309 
4310  WRITE (ndso,4111) tname
4311  WRITE (ndso,4012) 1, (ijkobstr(ix, 1), ix=1,jobs)
4312  WRITE (ndso,4012) ncobst, (ijkobstr(ix, ncobst), ix=1,jobs)
4313  WRITE (ndso,*) ' '
4314 
4315  !!Li Bounary cell sequential numbers are read only if NBISMC>0
4316  IF( nbismc .GT. 0 ) THEN
4317  IF (flgnml) THEN
4318  ndstr = nml_smc%BUNDY%IDF
4319  idla = nml_smc%BUNDY%IDLA
4320  idfm = nml_smc%BUNDY%IDFM
4321  rform = trim(nml_smc%BUNDY%FORMAT)
4322  tname = trim(nml_smc%BUNDY%FILENAME)
4323  ELSE
4324  CALL nextln ( comstr , ndsi , ndse )
4325  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4326  END IF
4327  OPEN (ndstr,file=trim(fnmpre)//tname, &
4328  form='FORMATTED',status='OLD',err=2000)
4329  ALLOCATE ( nbicelin( nbismc ) )
4330  CALL ina2i ( nbicelin, 1, nbismc, 1, 1, 1, nbismc, ndstr, ndst, &
4331  ndse, idfm, rform, idla, 1, 0)
4332  CLOSE(ndstr)
4333 
4334  WRITE (ndso,4013) tname
4335  WRITE (ndso,4014) 1, nbicelin( 1)
4336  WRITE (ndso,4014) nbismc, nbicelin(nbismc)
4337  WRITE (ndso,*) ' '
4338  ENDIF
4339  !
4340  !! 7.j Read Arctic grid cell and boundary cell integer arrays.
4341  IF( arctc ) THEN
4342 
4343  IF (flgnml) THEN
4344  ndstr = nml_smc%MBARC%IDF
4345  idla = nml_smc%MBARC%IDLA
4346  idfm = nml_smc%MBARC%IDFM
4347  rform = trim(nml_smc%MBARC%FORMAT)
4348  tname = trim(nml_smc%MBARC%FILENAME)
4349  ELSE
4350  CALL nextln ( comstr , ndsi , ndse )
4351  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4352  END IF
4353  OPEN (ndstr,file=trim(fnmpre)//tname, &
4354  form='FORMATTED',status='OLD',err=2000)
4355  READ (ndstr,*) narc, nbgl, nbac
4356  WRITE (ndso,4015) narc, nbgl, nbac
4357 
4358  ALLOCATE ( ijkcelac( 5, narc) )
4359  CALL ina2i ( ijkcelac, 5, narc, 1, 5, 1, narc, ndstr, ndst, ndse, &
4360  idfm, rform, idla, 1, 0)
4361  CLOSE(ndstr)
4362  !!Li Offset to change Equator index = 0 to regular grid index JEQT
4363  ijkcelac( 2, :) = ijkcelac( 2, :) + jeqt
4364  ijkcelac( 1, :) = ijkcelac( 1, :) + ishft
4365 
4366  WRITE (ndso,4016) tname
4367  WRITE (ndso,4006) 1,(ijkcelac(ix, 1), ix=1,5)
4368  WRITE (ndso,4006) narc,(ijkcelac(ix, narc), ix=1,5)
4369  WRITE (ndso,*) ' '
4370 
4371  IF (flgnml) THEN
4372  ndstr = nml_smc%AISID%IDF
4373  idla = nml_smc%AISID%IDLA
4374  idfm = nml_smc%AISID%IDFM
4375  rform = trim(nml_smc%AISID%FORMAT)
4376  tname = trim(nml_smc%AISID%FILENAME)
4377  ELSE
4378  CALL nextln ( comstr , ndsi , ndse )
4379  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4380  END IF
4381  OPEN (ndstr,file=trim(fnmpre)//tname, &
4382  form='FORMATTED',status='OLD',err=2000)
4383  READ (ndstr,*) naui
4384  WRITE (ndso,4017) naui
4385 
4386  ALLOCATE ( ijkufcac( 7, naui) )
4387  CALL ina2i ( ijkufcac, 7, naui, 1, 7, 1, naui, ndstr, ndst, ndse, &
4388  idfm, rform, idla, 1, 0)
4389  CLOSE(ndstr)
4390  !!Li Offset to change Equator index = 0 to regular grid index
4391  ijkufcac( 2, :) = ijkufcac( 2, :) + jeqt
4392  ijkufcac( 1, :) = ijkufcac( 1, :) + ishft
4393  !!Li Offset Arctic cell sequential numbers by global cell number NGLO
4394  DO ip=1, naui
4395  DO ix=4,7
4396  IF( ijkufcac(ix,ip) > 0 ) ijkufcac(ix,ip) = ijkufcac(ix,ip) + nglo
4397  ENDDO
4398  ENDDO
4399 
4400  WRITE (ndso,4018) tname
4401  WRITE (ndso,4009) 1,(ijkufcac(ix, 1), ix=1,7)
4402  WRITE (ndso,4009) naui,(ijkufcac(ix, naui), ix=1,7)
4403  WRITE (ndso,*) ' '
4404 
4405  IF (flgnml) THEN
4406  ndstr = nml_smc%AJSID%IDF
4407  idla = nml_smc%AJSID%IDLA
4408  idfm = nml_smc%AJSID%IDFM
4409  rform = trim(nml_smc%AJSID%FORMAT)
4410  tname = trim(nml_smc%AJSID%FILENAME)
4411  ELSE
4412  CALL nextln ( comstr , ndsi , ndse )
4413  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFM, RFORM, tname
4414  END IF
4415  OPEN (ndstr,file=trim(fnmpre)//tname, &
4416  form='FORMATTED',status='OLD',err=2000)
4417  READ (ndstr,*) navj
4418  WRITE (ndso,4019) navj
4419 
4420  ALLOCATE ( ijkvfcac( 8, navj) )
4421  CALL ina2i ( ijkvfcac, 8, navj, 1, 8, 1, navj, ndstr, ndst, ndse, &
4422  idfm, rform, idla, 1, 0)
4423  CLOSE(ndstr)
4424  !!Li Offset to change Equator index = 0 to regular grid index
4425  ijkvfcac( 2, :) = ijkvfcac( 2, :) + jeqt
4426  ijkvfcac( 1, :) = ijkvfcac( 1, :) + ishft
4427  !!Li Offset Arctic cell sequential numbers by global cell number NGLO
4428  DO ip=1, navj
4429  DO iy=4,7
4430  IF( ijkvfcac(iy,ip) > 0 ) ijkvfcac(iy,ip) = ijkvfcac(iy,ip) + nglo
4431  ENDDO
4432  ENDDO
4433 
4434  WRITE (ndso,4020) tname
4435  WRITE (ndso,4012) 1,(ijkvfcac(ix, 1), ix=1,8)
4436  WRITE (ndso,4012) navj,(ijkvfcac(ix, navj), ix=1,8)
4437  WRITE (ndso,*) ' '
4438 
4439  !!Li Reset total cell and face numbers
4440  ncel = nglo + narc
4441  nufc = ngui + naui
4442  nvfc = ngvj + navj
4443  !!Li Also append Arctic part into base level sub-loops
4444  nlvcelsk(nrlv)=nlvcelsk(nrlv)+narc
4445  nlvufcsk(nrlv)=nlvufcsk(nrlv)+naui
4446  nlvvfcsk(nrlv)=nlvvfcsk(nrlv)+navj
4447  !!Li Reset NBAC to total number of boundary cells.
4448  nbac = nbgl + nbac
4449 
4450  ENDIF !! ARCTC section.
4451 
4452  ENDIF !! GTYPE .EQ. SMCTYPE
4453 #endif
4454  !
4455  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4456  ! 8. Finalize status maps
4457  ! 8.a Defines open boundary conditions for UNST grids
4458  !
4459  j = len_trim(ugobcfile)
4460  IF (gtype.EQ.ungtype.AND.ugobcfile(:j).NE.'unset') &
4461  CALL readmshobc(ndsg,ugobcfile,tmpsta,ugobcok)
4462  IF ((gtype.EQ.ungtype).AND.ugobcauto.AND.(.NOT.ugobcok)) &
4463  CALL ug_getopenboundary(tmpsta,zbin,ugobcdepth)
4464  !
4465  ! 8.b Determine where to get the data
4466  !
4467  IF (flgnml) THEN
4468  ndstr = nml_mask%IDF
4469  idla = nml_mask%IDLA
4470  idft = nml_mask%IDFM
4471  rform = trim(nml_mask%FORMAT)
4472  from = trim(nml_mask%FROM)
4473  tname = trim(nml_mask%FILENAME)
4474  IF (tname.EQ.'unset' .OR. tname.EQ.'UNSET') from='PART'
4475  ELSE
4476  CALL nextln ( comstr , ndsi , ndse )
4477  READ (ndsi,*,END=2001,ERR=2002) NDSTR, IDLA, IDFT, RFORM, &
4478  from, tname
4479  END IF
4480  !
4481  ! ... Data to be read in parts
4482  !
4483  IF ( from .EQ. 'PART' ) THEN
4484  !
4485  ! 8.b Update TMPSTA with input boundary data (ILOOP=1)
4486  ! and excluded points (ILOOP=2)
4487  !
4488  IF ( iclose .EQ. iclose_trpl ) THEN
4489  WRITE(ndse,*)'PROGRAM W3GRID STATUS MAP CALCULATION IS '// &
4490  'NOT TESTED FOR TRIPOLE GRIDS FOR CASE WHERE USER OPTS '// &
4491  'TO READ DATA IN PARTS. STOPPING NOW (107).'
4492  CALL extcde ( 107 )
4493  END IF
4494  DO iloop=1, 2
4495  !
4496  i = 1
4497  IF ( iloop .EQ. 1 ) THEN
4498  WRITE (ndso,979) 'boundary points'
4499  nstat = 2
4500  ELSE
4501  WRITE (ndso,979) 'excluded points'
4502  nstat = -1
4503  END IF
4504  first = .true.
4505  !
4506  DO
4507  IF (flgnml) THEN
4508  ! inbound points
4509  IF (iloop.EQ.1) THEN
4510  IF (nml_inbnd_count%N_POINT.GT.0 .AND. i.LE.nml_inbnd_count%N_POINT) THEN
4511  ix = nml_inbnd_point(i)%X_INDEX
4512  iy = nml_inbnd_point(i)%Y_INDEX
4513  connct = nml_inbnd_point(i)%CONNECT
4514  i=i+1
4515  ELSE
4516  EXIT
4517  END IF
4518  ! excluded points
4519  ELSE IF (iloop.EQ.2) THEN
4520  IF (nml_excl_count%N_POINT.GT.0 .AND. i.LE.nml_excl_count%N_POINT) THEN
4521  ix = nml_excl_point(i)%X_INDEX
4522  iy = nml_excl_point(i)%Y_INDEX
4523  connct = nml_excl_point(i)%CONNECT
4524  i=i+1
4525  ELSE
4526  EXIT
4527  END IF
4528  END IF
4529  ELSE
4530  CALL nextln ( comstr , ndsi , ndse )
4531  READ (ndsi,*,END=2001,ERR=2002) IX, IY, connct
4532  END IF
4533  !
4534  ! ... Check if last point reached.
4535  !
4536  IF (ix.EQ.0 .AND. iy.EQ.0) EXIT
4537  !
4538  ! ... Check if point in grid.
4539  !
4540  IF (gtype.EQ.ungtype.AND.(ugobcauto.OR.ugobcok)) cycle
4541  IF (ix.LT.1 .OR. ix.GT.nx .OR. iy.LT.1 .OR. iy.GT.ny) THEN
4542  WRITE (ndso,981)
4543  WRITE (ndso,*) ' ', ix, iy
4544  cycle
4545  END IF
4546  !
4547  ! ... Check if intermediate points are to be added.
4548  !
4549  IF ( connct .AND. .NOT.first ) THEN
4550  idx = ix - ixo
4551  idy = iy - iyo
4552  IF ( idx.EQ.0 .OR. idy.EQ.0 .OR. &
4553  abs(idx).EQ.abs(idy) ) THEN
4554  nba = max( max(abs(idx),abs(idy))-1 , 0 )
4555  IF (idx.NE.0) idx = sign(1,idx)
4556  IF (idy.NE.0) idy = sign(1,idy)
4557  ix = ixo
4558  iy = iyo
4559  DO iba=1, nba
4560  ix = ix + idx
4561  iy = iy + idy
4562  IF ( tmpsta(iy,ix).EQ.1 .OR. j.EQ.2 ) THEN
4563  tmpsta(iy,ix) = nstat
4564  ELSE
4565  WRITE(ndso,*) 'WARNING: POINT (',ix,',',iy, &
4566  ') CANNOT BE GIVEN THE STATUS ',nstat
4567  END IF
4568  END DO
4569  ix = ix + idx
4570  iy = iy + idy
4571  ELSE
4572  WRITE (ndso,982)
4573  WRITE (ndso,*) ' ', ix , iy
4574  WRITE (ndso,*) ' ', ixo, iyo
4575  END IF
4576  END IF
4577  !
4578  ! ... Check if point itself is to be added
4579  !
4580  IF ( tmpsta(iy,ix).EQ.1 .OR. j.EQ.2 ) THEN
4581  tmpsta(iy,ix) = nstat
4582  END IF
4583  !
4584  ! ... Save data of previous point
4585  !
4586  ixo = ix
4587  iyo = iy
4588  first = .false.
4589  !
4590  ! ... Branch back to read.
4591  !
4592  END DO
4593  !
4594  ! 8.c Final processing excluded points
4595  !
4596  IF ( iloop .EQ. 2 ) THEN
4597  !
4598  i = 1
4599  DO
4600  IF (flgnml) THEN
4601  ! excluded bodies
4602  IF (nml_excl_count%N_BODY.GT.0 .AND. i.LE.nml_excl_count%N_BODY) THEN
4603  ix = nml_excl_body(i)%X_INDEX
4604  iy = nml_excl_body(i)%Y_INDEX
4605  i=i+1
4606  ELSE
4607  EXIT
4608  END IF
4609  ELSE
4610  CALL nextln ( comstr , ndsi , ndse )
4611  READ (ndsi,*,END=2001,ERR=2002) IX, iy
4612  END IF
4613  !
4614  ! ... Check if last point reached.
4615  !
4616  IF (ix.EQ.0 .AND. iy.EQ.0) EXIT
4617  !
4618  ! ... Check if point in grid.
4619  !
4620  IF (ix.LT.1 .OR. ix.GT.nx .OR. iy.LT.1 .OR. iy.GT.ny) THEN
4621  WRITE (ndso,981)
4622  WRITE (ndso,*) ' ', ix, iy
4623  cycle
4624  END IF
4625  !
4626  ! ... Check if point already excluded
4627  !
4628  IF ( tmpsta(iy,ix) .EQ. nstat ) THEN
4629  WRITE (ndso,1981)
4630  WRITE (ndso,*) ' ', ix, iy
4631  cycle
4632  END IF
4633  !
4634  ! ... Search for points to exclude
4635  !
4636  tmpmap = tmpsta
4637  j = 1
4638  ix1 = ix
4639  iy1 = iy
4640  !
4641  jj = tmpsta(iy,ix)
4642  tmpsta(iy,ix) = nstat
4643  DO
4644  nbt = 0
4645  DO ix=max(1,ix1-j), min(ix1+j,nx)
4646  DO iy=max(1,iy1-j), min(iy1+j,ny)
4647  IF ( tmpsta(iy,ix) .EQ. jj ) THEN
4648  IF (ix.GT.1) THEN
4649  IF (tmpsta(iy ,ix-1).EQ.nstat &
4650  .AND. tmpmap(iy ,ix-1).EQ.jj ) THEN
4651  tmpsta(iy,ix) = nstat
4652  END IF
4653  END IF
4654  IF (ix.LT.nx) THEN
4655  IF (tmpsta(iy ,ix+1).EQ.nstat &
4656  .AND. tmpmap(iy ,ix+1).EQ.jj ) THEN
4657  tmpsta(iy,ix) = nstat
4658  END IF
4659  END IF
4660  IF (iy.LT.ny) THEN
4661  IF (tmpsta(iy+1,ix ).EQ.nstat &
4662  .AND. tmpmap(iy+1,ix ).EQ.jj ) THEN
4663  tmpsta(iy,ix) = nstat
4664  END IF
4665  END IF
4666  IF (iy.GT.1) THEN
4667  IF (tmpsta(iy-1,ix ).EQ.nstat &
4668  .AND. tmpmap(iy-1,ix ).EQ.jj ) THEN
4669  tmpsta(iy,ix) = nstat
4670  END IF
4671  END IF
4672  IF (tmpsta(iy,ix).EQ.nstat) nbt = nbt + 1
4673  END IF
4674  END DO
4675  END DO
4676  !
4677  IF ( nbt .NE. 0 ) THEN
4678  j = j + 1
4679  ELSE
4680  EXIT
4681  END IF
4682  END DO
4683  END DO
4684  !
4685  ! ... Outer boundary excluded points
4686  !
4687  IF ( gtype.NE.ungtype ) THEN
4688 
4689  DO ix=1, nx
4690  IF ( tmpsta( 1,ix) .EQ. 1 ) tmpsta( 1,ix) = nstat
4691  IF ( tmpsta(ny,ix) .EQ. 1 ) tmpsta(ny,ix) = nstat
4692  END DO
4693  !
4694  IF ( iclose.EQ.iclose_none ) THEN
4695  DO iy=2, ny-1
4696  IF ( tmpsta(iy, 1) .EQ. 1 ) tmpsta(iy, 1) = nstat
4697  IF ( tmpsta(iy,nx) .EQ. 1 ) tmpsta(iy,nx) = nstat
4698  END DO
4699  END IF
4700 
4701  END IF ! GTYPE
4702  !
4703  END IF ! ILOOP .EQ. 2
4704  !
4705  ! ... Branch back input / excluded points ( ILOOP in 8.b )
4706  !
4707  END DO
4708  !
4709  ELSE ! FROM .EQ. PART
4710  !
4711  ! 8.d Read the map from file instead
4712  !
4713  nstat = -1
4714  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
4715  IF (idft.LT.1 .OR. idft.GT.3) idft = 1
4716 
4717  !!Li Suspended for SMC grid though the file input line in ww3_grid.inp
4718  !!Li is kept to divert the program into this block. JGLi15Oct2014
4719  !!Li
4720  IF( gtype .NE. smctype ) THEN
4721  !!Li
4722  !
4723  WRITE (ndso,978) ndstr, idla, idft
4724  IF (idft.EQ.2) WRITE (ndso,973) rform
4725  IF (from.EQ.'NAME') WRITE (ndso,974) tname
4726  !
4727  IF ( ndstr .EQ. ndsi ) THEN
4728  IF ( idft .EQ. 3 ) THEN
4729  WRITE (ndse,1004) ndstr
4730  CALL extcde (23)
4731  ELSE
4732  CALL nextln ( comstr , ndsi , ndse )
4733  END IF
4734  ELSE
4735  IF ( idft .EQ. 3 ) THEN
4736  IF (from.EQ.'NAME') THEN
4737  OPEN (ndstr,file=trim(fnmpre)//tname, &
4738  form='UNFORMATTED', convert=file_endian,status='OLD',err=2000, &
4739  iostat=ierr)
4740  ELSE
4741  OPEN (ndstr, form='UNFORMATTED', convert=file_endian, &
4742  status='OLD',err=2000,iostat=ierr)
4743  END IF
4744  ELSE
4745  IF (from.EQ.'NAME') THEN
4746  OPEN (ndstr,file=trim(fnmpre)//tname, &
4747  status='OLD',err=2000,iostat=ierr)
4748  ELSE
4749  OPEN (ndstr, &
4750  status='OLD',err=2000,iostat=ierr)
4751  END IF
4752  END IF
4753  END IF
4754  !
4755  ALLOCATE ( readmp(nx,ny) )
4756  CALL ina2i ( readmp, nx, ny, 1, nx, 1, ny, ndstr, ndst, &
4757  ndse, idft, rform, idla, 1, 0 )
4758  !
4759  IF ( iclose.EQ.iclose_none ) THEN
4760  DO iy=2, ny-1
4761  IF ( readmp( 1,iy) .EQ. 1 ) readmp( 1,iy) = 3
4762  IF ( readmp(nx,iy) .EQ. 1 ) readmp(nx,iy) = 3
4763  END DO
4764  END IF
4765  !
4766  DO ix=1, nx
4767  IF ( readmp(ix, 1) .EQ. 1 ) readmp(ix, 1) = 3
4768  IF ( readmp(ix,ny) .EQ. 1 .AND. iclose .NE. iclose_trpl) &
4769  readmp(ix,ny) = 3
4770  END DO
4771  !
4772  DO iy=1, ny
4773  DO ix=1, nx
4774  IF ( readmp(ix,iy) .EQ. 3 ) THEN
4775  tmpsta(iy,ix) = nstat
4776  ELSE
4777  tmpsta(iy,ix) = readmp(ix,iy)
4778  ! force to dry the sea points over zlim
4779  IF ( zbin(ix,iy) .GT. zlim ) tmpsta(iy,ix) = 0
4780  END IF
4781  END DO
4782  END DO
4783  DEALLOCATE ( readmp )
4784  !!Li
4785  ENDIF !! GTYPE .NE. SMCTYPE
4786  !
4787  END IF !FROM .NE. 'PART'
4788  !
4789  ! 8.e Get NSEA and other counters
4790  !
4791  nsea = 0
4792  nland = 0
4793  nbi = 0
4794  nbt = 0
4795  !
4796  DO ix=1, nx
4797  DO iy=1, ny
4798  IF ( tmpsta(iy,ix) .GT. 0 ) nsea = nsea + 1
4799  IF ( tmpsta(iy,ix) .EQ. 0 ) nland = nland + 1
4800  IF ( tmpsta(iy,ix) .LT. 0 ) nbt = nbt + 1
4801  IF ( tmpsta(iy,ix) .EQ. 2 ) nbi = nbi + 1
4802  END DO
4803  END DO
4804  !
4805 #ifdef W3_SMC
4806  IF( gtype .EQ. smctype ) THEN
4807  !Li Moved before FLBPI is defined with NBI value. JGLi05Jun2015
4808  !Li Overwrite NSEA with NCel for SMC grid.
4809  nsea = ncel
4810  !Li Use input NBI number for SMC grid because merged
4811  !Li cells are over-counted by model.
4812  nbi = nbismc
4813  !Li No land points are used in SMC grid. JGLi26Feb2016
4814  nland = 0
4815  ENDIF !! GTYPE .EQ. SMCTYPE
4816 #endif
4817  !
4818  WRITE (ndso,980)
4819  flbpi = nbi .GT. 0
4820  IF ( .NOT. flbpi ) THEN
4821  WRITE (ndso,985)
4822  ELSE
4823  WRITE (ndso,986) nbi
4824 #ifdef W3_O1
4825  IF ( flagll ) THEN
4826  WRITE (ndso, 987)
4827  ELSE
4828  WRITE (ndso,1987)
4829  END IF
4830  ibi = 1
4831  DO iy=1, ny
4832  DO ix=1, nx
4833  IF (gtype.NE.ungtype) THEN
4834  x = factor * ( xgrdin(ix,iy) )
4835  y = factor * ( ygrdin(ix,iy) )
4836  ELSE
4837  x = factor * xgrd(1,ix)
4838  y = factor * ygrd(1,ix)
4839  END IF
4840  IF ( tmpsta(iy,ix).EQ.2 ) THEN
4841  IF ( flagll ) THEN
4842  WRITE (ndso, 988) ibi, ix, iy, x, y
4843  ELSE
4844  WRITE (ndso,1988) ibi, ix, iy, x, y
4845  END IF
4846  ibi = ibi + 1
4847  END IF
4848  END DO
4849  END DO
4850 #endif
4851  END IF
4852  !
4853  WRITE (ndso,1980)
4854  IF ( nbt .EQ. 0 ) THEN
4855  WRITE (ndso,1985)
4856  ELSE
4857  WRITE (ndso,1986) nbt
4858  END IF
4859  !
4860  ! 8.f Set up all maps
4861  !
4862  CALL w3dimx ( 1, nx, ny, nsea, ndse, ndst &
4863 #ifdef W3_SMC
4864  , ncel, nufc, nvfc, nrlv, nbsmc &
4865  , narc, nbac, nspec &
4866 #endif
4867  )
4868 #ifdef W3_SMC
4869  WRITE (ndso,4021) ncel
4870 #endif
4871  !
4872  ! 8.g Activation of reflections and scattering
4873  ffacberg=facberg
4874 #ifdef W3_REF1
4875  refpars(1)=refcoast
4876  refpars(2)=refsubgrid
4877  refpars(3)=refunstsource
4878  refpars(4)=reficeberg
4879  refpars(6)=reffreq
4880  refpars(7)=refslope
4881  refpars(8)=refcosp_straight
4882  refpars(9)=refrmax
4883  refpars(10)=reffreqpow
4884  IF (gtype.EQ.ungtype) refpars(2:5)=0.
4885  IF (refmap.EQ.0) THEN
4886  reflc(3,:)=refpars(7)
4887  END IF
4888 #endif
4889 
4890 
4891  IF (gtype.NE.ungtype) THEN
4892  DO iy=1, ny
4893  DO ix=1, nx
4894  xgrd(iy,ix) = xgrdin(ix,iy)
4895  ygrd(iy,ix) = ygrdin(ix,iy)
4896  END DO
4897  END DO
4898  DEALLOCATE ( xgrdin, ygrdin )
4899  CALL w3gntx ( 1, 6, 6 )
4900  ELSE
4901  END IF ! GTYPE
4902  !
4903 #ifdef W3_SMC
4904  !!Li Shelter MAPSTA LLG definition for SMC
4905  IF( gtype .NE. smctype ) THEN
4906 #endif
4907  !
4908  mapsta = tmpsta
4909  mapfs = 0
4910  !
4911 #ifdef W3_T
4912  ALLOCATE ( mapout(nx,ny) )
4913  mapout = 0
4914  !
4915  ix3 = 1 + nx/60
4916  iy3 = 1 + ny/60
4917  CALL prtblk (ndst, nx, ny, nx, zbin, mapout, 1, 0., &
4918  1, nx, ix3, 1, ny, iy3, 'Zb', 'm')
4919 #endif
4920  !
4921  trnx = 0.
4922  trny = 0.
4923  !
4924  isea = 0
4925  DO iy=1, ny
4926  DO ix=1, nx
4927  IF ( tmpsta(iy,ix) .EQ. nstat ) THEN
4928  mapsta(iy,ix) = 0
4929  mapst2(iy,ix) = 1
4930  tmpsta(iy,ix) = 3
4931  ELSE
4932  mapsta(iy,ix) = tmpsta(iy,ix)
4933  mapst2(iy,ix) = 0
4934  END IF
4935  IF ( mapsta(iy,ix) .NE. 0 ) THEN
4936  isea = isea + 1
4937  mapfs(iy,ix) = isea
4938  zb(isea) = zbin(ix,iy)
4939 #ifdef W3_T
4940  mapout(ix,iy) = 1
4941 #endif
4942  mapsf(isea,1) = ix
4943  mapsf(isea,2) = iy
4944  IF ( flagll ) THEN
4945  y = ygrd(iy,ix)
4946  clats(isea) = cos(y*dera)
4947  clatis(isea) = 1. / clats(isea)
4948  cthg0s(isea) = - tan(dera*y) / radius
4949  ELSE
4950  clats(isea) = 1.
4951  clatis(isea) = 1.
4952  cthg0s(isea) = 0.
4953  END IF
4954  END IF
4955 
4956  !/ ------------------------------------------------------------------- /
4957 
4958  ! notes: Oct 22 2012: I moved the following "if-then" statement from
4959  ! inside the "IF ( MAPSTA(IY,IX) .NE. 0 )" statement to outside that
4960  ! statement. This is needed since later on, ATRNX is computed from
4961  ! TRNX(ix-1) , TRNX(ix) etc. which causes boundary effects if the
4962  ! MAPSTA=0 values are set to TRNX=0
4963 
4964  IF ( trflag .NE. 0 ) THEN
4965  trnx(iy,ix) = 1. - obsx(ix,iy)
4966  trny(iy,ix) = 1. - obsy(ix,iy)
4967  END IF
4968 
4969  END DO
4970  END DO
4971  !
4972 #ifdef W3_SMC
4973  !!Li SMC grid definition of mapping arrays.
4974  ELSE
4975  !!Li Pass refined level cell and face counts to NLv*(NRLv)
4976  nlvcel(0)=0
4977  nlvufc(0)=0
4978  nlvvfc(0)=0
4979  DO ip = 1, nrlv
4980  nlvcel(ip)=nlvcelsk(ip) + nlvcel(ip-1)
4981  nlvufc(ip)=nlvufcsk(ip) + nlvufc(ip-1)
4982  nlvvfc(ip)=nlvvfcsk(ip) + nlvvfc(ip-1)
4983  ENDDO
4984  WRITE (ndso,4022) nlvcel
4985  WRITE (ndso,4023) nlvufc
4986  WRITE (ndso,4024) nlvvfc
4987 
4988  !Li Redefine MAPSF MAPFS MAPSTA MAPST2 CLATS and ZB for SMC Grid,
4989  !Li using SMC grid cell array and assuming NSEA=NCel.
4990  mapsta = 0
4991  mapst2 = 1
4992  mapfs = 0
4993  !LS Allocation for read-in variables that remain local only.
4994  ALLOCATE ( ijkvfc8(nvfc) )
4995  ALLOCATE ( ijkdep(-9:ncel) )
4996 
4997  !Li Pass input SMC arrays to newly declared grid arrays.
4998  WRITE (ndso,4025) ncel
4999  ijkcel(1:4, 1:nglo)=ijkcelin(1:4, 1:nglo)
5000  ijkdep(1:nglo)=ijkcelin(5, 1:nglo)
5001  ijkufc(1:7, 1:ngui)=ijkufcin(1:7, 1:ngui)
5002  ijkvfc(1:7, 1:ngvj)=ijkvfcin(1:7, 1:ngvj)
5003  ijkvfc8(1:ngvj)=ijkvfcin(8, 1:ngvj)
5004  !Li Append Arctic part
5005  IF( arctc ) THEN
5006  ijkcel(1:4, nglo+1:ncel)=ijkcelac(1:4, 1:narc)
5007  ijkdep(nglo+1:ncel)=ijkcelac(5, 1:narc)
5008  ijkufc(1:7, ngui+1:nufc)=ijkufcac(1:7, 1:naui)
5009  ijkvfc(1:7, ngvj+1:nvfc)=ijkvfcac(1:7, 1:navj)
5010  ijkvfc8(ngvj+1:nvfc)=ijkvfcac(8, 1:navj)
5011  ENDIF !! ARCTC
5012 
5013  WRITE (ndso,4026)
5014  WRITE (ndso,4006) 1,(ijkcel(ix, 1), ix=1,4), ijkdep(1)
5015  jj=ncel
5016  WRITE (ndso,4006) jj,(ijkcel(ix, jj), ix=1,4), ijkdep(jj)
5017  WRITE (ndso,*) ' '
5018  WRITE (ndso,4027)
5019  WRITE (ndso,4009) 1,(ijkufc(ix, 1), ix=1,7)
5020  jj=nufc
5021  WRITE (ndso,4009) jj,(ijkufc(ix, jj), ix=1,7)
5022  WRITE (ndso,*) ' '
5023  WRITE (ndso,4028)
5024  WRITE (ndso,4012) 1,(ijkvfc(ix, 1), ix=1,7), ijkvfc8(1)
5025  jj=nvfc
5026  WRITE (ndso,4012) jj,(ijkvfc(ix, jj), ix=1,7), ijkvfc8(jj)
5027  WRITE (ndso,*) ' '
5028 
5029  !Li Boundary -9 to 0 cells for cell x-size 2**n
5030  !Li Note the position indice for bounary cell are not used.
5031  ijkcel(1, -9:0)=0
5032  !Li Use Equator Y index for boundary cells. JGLi04Apr2011
5033  !Li IJKCel(2, -9:0)=0
5034  ijkcel(2, -9:0)=jeqt
5035  ijkcel(3, 0)=1
5036  ijkcel(4, 0)=1
5037  !Li Use minimum 10 m depth for boundary cells.
5038  !Li Y-size is restricted below base-cell value.
5039  !Li For refined boundary cells, its y-size is replaced with
5040  !Li the inner cell y-size for flux gradient.
5041  ijkdep(0)=10
5042  DO ip=1,9
5043  ijkcel(3,-ip)=ijkcel(3,-ip+1)*2
5044  ik=min(ip, nrlv-1)
5045  ijkcel(4,-ip)=2**ik
5046  ijkdep(-ip)=10
5047  ENDDO
5048  WRITE (ndso,4029)
5049  DO ip=0, -9, -1
5050  WRITE (ndso,4030) ijkcel(:,ip), ijkdep(ip)
5051  ENDDO
5052 
5053  WRITE (ndso,4031) ncel
5054  !Li Multi-resolution SMC grid requires rounding of x, y indices
5055  !Li by a factor MRFct.
5056  mrfct = 2**(nrlv - 1)
5057  WRITE (ndso,4032) mrfct
5058 
5059  !Li Cosine for SMC uses refined latitude increment.
5060  symr = sy*dera/float( mrfct )
5061  !Li Reference y point for adjusted cell j=0 in radian. JGLi16Feb2016
5062  yj0r = ( y0 - 0.5*sy )*dera
5063 
5064  DO isea=1, ncel
5065  !Li There is no polar cell row so it is mapped to last row.
5066  IF( arctc .AND. (isea .EQ. ncel) ) THEN
5067  ix=1
5068  iy=ny
5069  ik=1
5070  js=1
5071  ELSE
5072  ix=ijkcel(1,isea)/mrfct + 1
5073  iy=ijkcel(2,isea)/mrfct + 1
5074  ik=max(1, ijkcel(3,isea)/mrfct)
5075  js=max(1, ijkcel(4,isea)/mrfct)
5076  ENDIF
5077 
5078  ! Check that IX, IY are in the bound of [1,NX] and [1,NY] respec.
5079  IF ((ix+ik-1 .GT. nx) .OR. (ix .LE. 0)) THEN
5080  WRITE (ndse,1014) isea, ix, ix+ik-1, nx
5081  CALL extcde(65)
5082  END IF
5083 
5084  IF ((iy+js-1 .GT. ny) .OR. (iy .LE. 0)) THEN
5085  WRITE (ndse,1015) isea, iy, iy+js-1, ny
5086  CALL extcde(65)
5087  END IF
5088 
5089  !Li Allow land cell to be defined by ZLIM value and only reset
5090  !Li MAPST* land values for sea points. JGLi03Nov2023
5091  zb(isea) = dvsmc * float(ijkdep(isea))
5092  IF( zb(isea) .LT. zlim ) THEN
5093  mapsta(iy:iy+js-1,ix:ix+ik-1) = 1
5094  mapst2(iy:iy+js-1,ix:ix+ik-1) = 0
5095  ENDIF
5096  mapfs(iy:iy+js-1,ix:ix+ik-1) = isea
5097  mapsf(isea,1) = ix
5098  mapsf(isea,2) = iy
5099  mapsf(isea,3) = iy + (ix-1) * ny
5100 
5101  !Li New variable CLATS to hold cosine latitude at cell centre.
5102  !Li Also added CLATIS and CTHG0S for version 4.08.
5103  !Li Use adjusted j-index to calculate cell centre y from YJ0R.
5104  y = yj0r + symr*( float(ijkcel(2,isea))+0.5*float(ijkcel(4,isea)) )
5105  !Li Arctic polar cell does not need COS(LAT), set 1 row down.
5106  IF(y .GE. hpi-0.1*symr) y=hpi - symr*0.5*float( mrfct )
5107 
5108  clats(isea) = cos( y )
5109  clatis(isea)= 1. / clats(isea)
5110  cthg0s(isea)= - tan( y ) / radius
5111  !!Li Sub-grid obstruction is set zero beyond NCObst cells.
5112  IF(isea .GT. ncobst) THEN
5113  trnmx=1.0
5114  trnmy=1.0
5115  ELSE
5116  !!Li Present obstruction is isotropic and in percentage.
5117  trnmx=1.0 - ijkobstr(1, isea)*0.01
5118  trnmy=1.0 - ijkobstr(jobs, isea)*0.01
5119  ENDIF
5120  ctrnx(isea) = max(0.11, trnmx)
5121  ctrny(isea) = max(0.11, trnmy)
5122  END DO
5123  !!Li Transparency for boundary cells are 1.0 JGLi16Jan2012
5124  ctrnx(-9:0) = 1.0
5125  ctrny(-9:0) = 1.0
5126  !!Li Check range of MAPSF and MAPFS
5127  WRITE (ndso,4033) minval( mapsf(:,1) ), maxval( mapsf(:,1) )
5128  WRITE (ndso,4034) minval( mapsf(:,2) ), maxval( mapsf(:,2) )
5129  WRITE (ndso,4035) minval( mapsf(:,3) ), maxval( mapsf(:,3) )
5130  WRITE (ndso,4036) minval( mapfs(:,:) ), maxval( mapfs(:,:) )
5131 
5132  !Li New variable CLATF to hold cosine latitude at cell V face.
5133  DO ip = 1, nvfc
5134  ! CLATF(IP) = COS( SYMR*FLOAT(IJKVFc(2,IP) - JEQT) )
5135  !Li Use adjusted j-index to calculate cell face Y from YJ0R.
5136  clatf(ip) = cos( symr*float(ijkvfc(2,ip)) + yj0r )
5137  ENDDO
5138  IF(nbismc .GT. 0) THEN
5139  !Li Save input boundary SMC list to ISMCBP(NBSMC)
5140  ismcbp(1:nbismc) = nbicelin(1:nbismc)
5141  !Li Reset MAPSTA for boundary cells if any.
5142  DO ip=1, nbismc
5143  isea = nbicelin(ip)
5144  ix=ijkcel(1,isea)/mrfct + 1
5145  iy=ijkcel(2,isea)/mrfct + 1
5146  ik=max(1, ijkcel(3,isea)/mrfct)
5147  js=max(1, ijkcel(4,isea)/mrfct)
5148  mapsta(iy:iy+js-1,ix:ix+ik-1) = 2
5149  mapst2(iy:iy+js-1,ix:ix+ik-1) = 0
5150  ENDDO
5151  ENDIF
5152  !Li Define rotation angle for Arctic cells.
5153  IF( arctc ) THEN
5154 
5155  polonac = 179.999
5156  polatac = 0.001
5157  ALLOCATE( xlonac(narc),ylatac(narc),elonac(narc),elatac(narc) )
5158  DO isea=nglo+1, ncel
5159  !Li There is no polar cell row so it is mapped to last row.
5160  IF(isea .EQ. ncel) THEN
5161  ix=1
5162  iy=ny
5163  ik=1
5164  js=1
5165  ELSE
5166  ix=ijkcel(1,isea)/mrfct + 1
5167  iy=ijkcel(2,isea)/mrfct + 1
5168  ik=max(1, ijkcel(3,isea)/mrfct)
5169  js=max(1, ijkcel(4,isea)/mrfct)
5170  ENDIF
5171  xlonac(isea-nglo)= x0 + real(ix-1+ik/2)*sx
5172  ylatac(isea-nglo)= y0 + real(iy-1+js/2)*sy
5173  ENDDO
5174 
5175  CALL w3lltoeq ( ylatac, xlonac, elatac, elonac, &
5176  & angarc, polatac, polonac, narc )
5177 
5178  WRITE (ndso,4037) narc
5179  WRITE (ndso,4038) (angarc(ix), ix=1,narc,narc/8)
5180 
5181  !Li Mapping Arctic boundary cells with inner model cells
5182  DO ip=1, nbac
5183  ix=ijkcel(1,ip+nglo)
5184  iy=ijkcel(2,ip+nglo)
5185  DO isea=1, nglo
5186  IF( (ix .EQ. ijkcel(1,isea)) .AND. &
5187  & (iy .EQ. ijkcel(2,isea)) ) THEN
5188  iclbac(ip) = isea
5189  ENDIF
5190  ENDDO
5191  ENDDO
5192  WRITE (ndso,4039) nbac
5193  WRITE (ndso,4040) (iclbac(ix), ix=1,nbac,nbac/8)
5194 
5195  !Li Redefine GCT term factor for Arctic part or the netative of
5196  !Li tangient of rotated latitude divided by radius. JGLi14Sep2015
5197  DO isea=nglo+1, ncel-1
5198  cthg0s(isea)= - tan( elatac(isea-nglo)*dera ) / radius
5199  ENDDO
5200  cthg0s(ncel)=0.0
5201 
5202  ENDIF !! ARCTC section.
5203  ENDIF !! (GTYPE .NE. SMCTYPE) ELSE SMCTYPE block.
5204 #endif
5205  !
5206 #ifdef W3_RTD
5207  !Li Assign rotated grid angle for all sea points. JGLi01Feb2016
5208  DO isea=1,nsea
5209  ix = mapsf(isea,1)
5210  iy = mapsf(isea,2)
5211  angld(isea) = angldin(ix,iy)
5212  END DO
5213 #endif
5214  !
5215 #ifdef W3_T
5216  CALL prtblk (ndst, nx, ny, nx, zbin, mapout, 0, 0., &
5217  1, nx, ix3, 1, ny, iy3, 'Sea points', 'm')
5218  DEALLOCATE ( mapout )
5219 #endif
5220  !
5221  DO isp=1, nspec+nth
5222  mapwn(isp) = 1 + (isp-1)/nth
5223  mapth(isp) = 1 + mod(isp-1,nth)
5224  END DO
5225  !
5226 #ifdef W3_O2
5227  nmap = 1 + (nx-1)/ncol
5228  WRITE (ndso,1100) nmap
5229  DO imap=1, nmap
5230  ix0 = 1 + (imap-1)*ncol
5231  ixn = min( nx , imap*ncol )
5232  DO iy=ny,1,-1
5233  WRITE (ndso,1101) (tmpsta(iy,ix),ix=ix0,ixn)
5234  END DO
5235  WRITE (ndso,*) ' '
5236  END DO
5237  WRITE (ndso,1102)
5238 #endif
5239 
5240 #ifdef W3_O2a
5241  OPEN (ndsm,file=trim(fnmpre)//'mask.ww3')
5242  DO iy=1, ny
5243  WRITE (ndsm,998) min(1,mapsta(iy,:))
5244  END DO
5245  CLOSE (ndsm)
5246 #endif
5247  !
5248 #ifdef W3_O2b
5249  IF ( trflag .GT. 0 ) THEN
5250  nmapb = 1 + (nx-1)/ncol
5251  WRITE (ndso,1103) 'X', nmapb
5252  DO imapb=1, nmapb
5253  ix0 = 1 + (imapb-1)*ncol
5254  ixn = min( nx , imapb*ncol )
5255  DO iy=ny,1,-1
5256  WRITE (ndso,1101) (nint(10.*obsx(ix,iy)),ix=ix0,ixn)
5257  END DO
5258  WRITE (ndso,*) ' '
5259  END DO
5260  WRITE (ndso,1104)
5261  WRITE (ndso,1103) 'Y', nmapb
5262  DO imapb=1, nmapb
5263  ix0 = 1 + (imapb-1)*ncol
5264  ixn = min( nx , imapb*ncol )
5265  DO iy=ny,1,-1
5266  WRITE (ndso,1101) (nint(10.*obsy(ix,iy)),ix=ix0,ixn)
5267  END DO
5268  WRITE (ndso,*) ' '
5269  END DO
5270  WRITE (ndso,1104)
5271  END IF
5272 #endif
5273  !
5274 #ifdef W3_O2c
5275  OPEN (ndsm,file=trim(fnmpre)//'mapsta.ww3', recl=2*nx*ny*50+1)
5276  DO iy=ny,1, -1
5277  DO ix=1,nx
5278  DO i=1,50
5279  WRITE (ndsm,1998,advance='NO') (tmpsta(iy,ix))
5280  END DO
5281  END DO
5282  END DO
5283  CLOSE (ndsm)
5284 #endif
5285  !
5286 
5287 #ifdef W3_IG1
5288  igpars(1)=igmethod
5289  igpars(2)=igaddoutp
5290  igpars(3)=igsource
5291  igpars(4)=0
5292  IF (igbcoverwrite) igpars(4)=igpars(4)+1
5293  IF (igswellmax) igpars(4)=igpars(4)+2
5294  igpars(5)=1
5295  DO ik=1,nk
5296  IF (sig(ik)*tpiinv.LT.igmaxfreq) igpars(5)=ik
5297  END DO
5298  igmindep=minval(zb*(-1.)-2) ! -2 / +2 is there for water level changes
5299  igmaxdep=maxval(zb*(-1.)+2)
5300  IF (igsourceatbp.EQ.1) igmindep=1. ! should use true minimum depth ...
5301  igpars(6)=1+nint(log(max(igmaxdep,1.0)/max(igmindep,1.0))/log(1.1))
5302  igpars(7)=max(igmindep,1.0)
5303  igpars(8)=igsourceatbp
5304  igpars(9)=igkdmin
5305  igpars(10)=igfixeddepth
5306  igpars(11)=igempirical**2
5307  igpars(12)=igsterms
5308 #endif
5309  !
5310 #ifdef W3_IC2
5311  ic2pars(:)=0.
5312  IF (ic2disper) ic2pars(1)=1.
5313  ic2pars(2)=ic2turb
5314  ic2pars(3)=ic2rough
5315  ic2pars(4)=ic2reynolds
5316  ic2pars(5)=ic2smooth
5317  ic2pars(6)=ic2visc
5318  ic2pars(7)=ic2turbs
5319  ic2pars(8)=ic2dmax
5320 #endif
5321  !
5322 #ifdef W3_IC3
5323  ic3pars(:)=0.
5324  ic3pars(1)=ic3maxthk
5325  ic3pars(2)=ic2turb
5326  ic3pars(3)=ic2rough
5327  ic3pars(4)=ic2reynolds
5328  ic3pars(5)=ic2smooth
5329  ic3pars(6)=ic2visc
5330  ic3pars(7)=ic2turbs
5331  ic3pars(8)=ic3maxcnc
5332  IF (ic3cheng) ic3pars(9)=1.0
5333  ic3pars(10)=ic3hilim
5334  ic3pars(11)=ic3kilim
5335  IF (usecgice) ic3pars(12)=1.0
5336  ic3pars(13)=ic3hice
5337  ic3pars(14)=ic3visc
5338  ic3pars(15)=ic3dens
5339  ic3pars(16)=ic3elas
5340 #endif
5341  !
5342 #ifdef W3_IC4
5343  ic4pars(1)=ic4method
5344  ic4_ki=ic4ki
5345  ic4_fc=ic4fc
5346  ic4_cn=ic4cn
5347  ic4_fmin=ic4fmin
5348  ic4_kibk=ic4kibk
5349 #endif
5350  !
5351 #ifdef W3_IC5
5352  ic5pars(:)=0.
5353  ic5pars(1)=ic5minig
5354  ic5pars(2)=ic5minwt
5355  ic5pars(3)=ic5maxkratio
5356  ic5pars(4)=ic5maxki
5357  ic5pars(5)=ic5minhw
5358  ic5pars(6)=ic5maxiter
5359  ic5pars(7)=ic5rkick
5360  ic5pars(8)=ic5kfilter
5361  ic5pars(9)=ic5vemod
5362 #endif
5363  !
5364 #ifdef W3_IS2
5365  is2pars(1) = isc1
5366  is2pars(2) = is2backscat
5367  is2pars(3)=0.
5368  IF (is2break) is2pars(3)=1.
5369  is2pars(4)=is2c2
5370  is2pars(5)=is2c3
5371  is2pars(6)=0.
5372  IF (is2disp) is2pars(6)=1.
5373  is2pars(7)=is2damp
5374  is2pars(8)=is2fragility
5375  is2pars(9)=is2dmin
5376  is2pars(10)=0.
5377  IF (is2dupdate) is2pars(10)=1.
5378  is2pars(11)=is2conc
5379  is2pars(12)=abs(is2creepb)
5380  is2pars(13)=is2creepc
5381  is2pars(14)=is2creepd
5382  is2pars(15)=is2creepn
5383  is2pars(16)=is2breake
5384  is2pars(17)=is2breakf
5385  is2pars(18)=is2wim1
5386  is2pars(19)=is2flexstr
5387  is2pars(20)=0.
5388  IF (is2isoscat) is2pars(20)=1.
5389  is2pars(21)=is2andisd
5390  is2pars(22)=is2andisn
5391  is2pars(23)=0.
5392  IF (is2andisb) is2pars(23)=1.
5393  is2pars(24)=is2andise
5394 #endif
5395  !
5396  ! 9.d Estimates shoreline direction for reflection
5397  ! and shoreline treatment in general for UNST grids.
5398  ! NB: this is updated with moving water levels in W3ULEV
5399  ! AR: this is not anymore needed and will be deleted ...
5400  !
5401  IF (gtype.EQ.ungtype) THEN
5402  CALL set_ug_iobp
5403 
5404 #ifdef W3_REF1
5405  ELSE
5406  CALL w3setref
5407 #endif
5408  END IF
5409 #ifdef W3_REF1
5410  !
5411  ! 9.a Reads shoreline slope (whith REF1 switch only)
5412  !
5413  ALLOCATE ( refd(nx,ny), refd2(nx,ny), refs(nx,ny) )
5414  IF (refmap.EQ.0) THEN
5415  refs(:,:)=1.
5416  ELSE
5417  !
5418  ! 9.b Info from input file
5419  !
5420  IF (flgnml) THEN
5421  ndstr = nml_slope%IDF
5422  vsc = nml_slope%SF
5423  idla = nml_slope%IDLA
5424  idft = nml_slope%IDFM
5425  rform = trim(nml_slope%FORMAT)
5426  from = trim(nml_slope%FROM)
5427  tname = trim(nml_slope%FILENAME)
5428  ELSE
5429  CALL nextln ( comstr , ndsi , ndse )
5430  READ (ndsi,*,END=2001,ERR=2002) NDSTR, VSC, IDLA, IDFT, RFORM, &
5431  from, tname
5432  END IF
5433  !
5434  IF ( abs(vsc) .LT. 1.e-7 ) vsc = 1.
5435  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
5436  IF (idft.LT.1 .OR. idft.GT.3) idft = 1
5437  !
5438  WRITE (ndso,1977) ndstr, vsc, idla, idft
5439  IF (idft.EQ.2) WRITE (ndso,973) rform
5440  IF (from.EQ.'NAME' .AND. ndsg.NE.ndstr) WRITE (ndso,974) tname
5441  !
5442  ! 9;c Open file and check if necessary
5443  !
5444  IF ( ndstr .EQ. ndsi ) THEN
5445  IF ( idft .EQ. 3 ) THEN
5446  WRITE (ndse,1004) ndstr
5447  CALL extcde (23)
5448  ELSE
5449  CALL nextln ( comstr , ndsi , ndse )
5450  END IF
5451  ELSE IF ( ndstr .EQ. ndsg ) THEN
5452  IF ( ( idfm.EQ.3 .AND. idft.NE.3 ) .OR. &
5453  ( idfm.NE.3 .AND. idft.EQ.3 ) ) THEN
5454  WRITE (ndse,1005) idfm, idft
5455  CALL extcde (24)
5456  END IF
5457  ELSE
5458  IF ( idft .EQ. 3 ) THEN
5459  IF (from.EQ.'NAME') THEN
5460  OPEN (ndstr,file=trim(fnmpre)//tname, &
5461  form='UNFORMATTED', convert=file_endian,status='OLD',err=2000, &
5462  iostat=ierr)
5463  ELSE
5464  OPEN (ndstr, form='UNFORMATTED', convert=file_endian, &
5465  status='OLD',err=2000,iostat=ierr)
5466  END IF
5467  ELSE
5468  IF (from.EQ.'NAME') THEN
5469  OPEN (ndstr,file=trim(fnmpre)//tname, &
5470  status='OLD',err=2000,iostat=ierr)
5471  ELSE
5472  OPEN (ndstr, &
5473  status='OLD',err=2000,iostat=ierr)
5474  END IF !end of (FROM.EQ.'NAME')
5475  END IF !end of ( IDFT .EQ. 3 )
5476  END IF !end of ( NDSTR .EQ. NDSG )
5477  !
5478  ! 9.d Read the data
5479  !
5480  ! CALL INA2R ( REFD, NX, NY, 1, NX, 1, NY, NDSTR, NDST, NDSE, &
5481  ! IDFM, RFORM, IDLA, VSC, 0.0)
5482  !
5483  IF ( ndstr .EQ. ndsi ) CALL nextln ( comstr , ndsi , ndse )
5484  !
5485  ! CALL INA2R ( REFD2, NX, NY, 1, NX, 1, NY, NDSTR, NDST, NDSE, &
5486  ! IDFM, RFORM, IDLA, VSC, 0.0)
5487  CALL ina2r ( refs, nx, ny, 1, nx, 1, ny, ndstr, ndst, ndse, &
5488  idfm, rform, idla, vsc, 0.0)
5489  DO isea=1,nsea
5490  ix = mapsf(isea,1)
5491  iy = mapsf(isea,2)
5492  reflc(3,isea) = refs(ix,iy)*refmap
5493  END DO
5494  nmapb = 1 + (nx-1)/ncol
5495  WRITE (ndso,1105) nmapb
5496 #endif
5497 #if defined W3_T && defined W3_REF1
5498  WRITE(ndso,*) 'Maximum slope for reflection:',maxval(refs*refmap)
5499 #endif
5500  !
5501 #ifdef W3_REF1
5502  DO imapb=1, nmapb
5503  ix0 = 1 + (imapb-1)*ncol
5504  ixn = min( nx , imapb*ncol )
5505 #endif
5506 #if defined W3_T && defined W3_REF1
5507  DO iy=ny,1,-1
5508  WRITE (ndso,1101) (nint(100.*refs(ix,iy)*refmap),ix=ix0,ixn)
5509  END DO
5510 #endif
5511 #ifdef W3_REF1
5512  WRITE (ndso,*) ' '
5513  END DO
5514  WRITE (ndso,1106)
5515  !
5516  WRITE (ndso,*)
5517  !
5518  END IF !end of (REFMAP.EQ.0)
5519 #endif
5520  !
5521  DEALLOCATE ( zbin, tmpsta, tmpmap )
5522 #ifdef W3_RTD
5523  DEALLOCATE ( angldin )
5524 #endif
5525  !
5526  ! 9.e Reads bottom information from file
5527  !
5528 #ifdef W3_BT4
5529  ALLOCATE ( sed_d50file(nx,ny))
5530  IF ( sedmapd50 ) THEN
5531 
5532  !
5533  ! 9.e.1 Info from input file
5534  !
5535  IF (flgnml) THEN
5536  ndstr = nml_sed%IDF
5537  vsc = nml_sed%SF
5538  idla = nml_sed%IDLA
5539  idft = nml_sed%IDFM
5540  rform = trim(nml_sed%FORMAT)
5541  from = trim(nml_sed%FROM)
5542  tname = trim(nml_sed%FILENAME)
5543  ELSE
5544  CALL nextln ( comstr , ndsi , ndse )
5545  READ (ndsi,*,END=2001,ERR=2002) NDSTR, VSC, IDLA, IDFT, RFORM, &
5546  from, tname
5547  END IF
5548  !
5549  IF ( abs(vsc) .LT. 1.e-7 ) THEN
5550  vsc = 1.
5551  ELSE
5552  ! WARNING TO BE ADDED ...
5553  END IF
5554  IF (idla.LT.1 .OR. idla.GT.4) idla = 1
5555  IF (idft.LT.1 .OR. idft.GT.3) idft = 1
5556  !
5557  WRITE (ndso,1978) ndstr, vsc, idla, idft
5558  IF (idft.EQ.2) WRITE (ndso,973) rform
5559  IF (from.EQ.'NAME' .AND. ndsg.NE.ndstr) WRITE (ndso,974) tname
5560  !
5561  ! 9.e.2 Open file and check if necessary
5562  !
5563  IF ( ndstr .EQ. ndsi ) THEN
5564  IF ( idft .EQ. 3 ) THEN
5565  WRITE (ndse,1004) ndstr
5566  CALL extcde (23)
5567  ELSE
5568  CALL nextln ( comstr , ndsi , ndse )
5569  END IF
5570  ELSE IF ( ndstr .EQ. ndsg ) THEN
5571  IF ( ( idfm.EQ.3 .AND. idft.NE.3 ) .OR. &
5572  ( idfm.NE.3 .AND. idft.EQ.3 ) ) THEN
5573  WRITE (ndse,1005) idfm, idft
5574  CALL extcde (24)
5575  END IF
5576  ELSE
5577  IF ( idft .EQ. 3 ) THEN
5578  IF (from.EQ.'NAME') THEN
5579  OPEN (ndstr,file=trim(fnmpre)//tname, &
5580  form='UNFORMATTED', convert=file_endian,status='OLD',err=2000, &
5581  iostat=ierr)
5582  ELSE
5583  OPEN (ndstr, form='UNFORMATTED', convert=file_endian, &
5584  status='OLD',err=2000,iostat=ierr)
5585  END IF
5586  ELSE
5587  IF (from.EQ.'NAME') THEN
5588  OPEN (ndstr,file=trim(fnmpre)//tname, &
5589  status='OLD',err=2000,iostat=ierr)
5590  ELSE
5591  OPEN (ndstr, &
5592  status='OLD',err=2000,iostat=ierr)
5593  END IF
5594  END IF
5595  END IF
5596  !
5597  ! 9.e.3 Read the data
5598  !
5599  CALL ina2r ( sed_d50file, nx, ny, 1, nx, 1, ny, ndstr, ndst, ndse, &
5600  idfm, rform, idla, vsc, vof)
5601  !
5602  IF ( ndstr .EQ. ndsi ) CALL nextln ( comstr , ndsi , ndse )
5603  !
5604  WRITE (ndso,*) 'Min and Max values of grain sizes:',minval(sed_d50file), maxval(sed_d50file)
5605  WRITE (ndso,*)
5606  !
5607  ELSE
5608  sed_d50file(:,:)=sed_d50_uniform
5609  END IF
5610  !
5611  DO iy=1, ny
5612  DO ix=1, nx
5613  isea = mapfs(iy,ix)
5614  sed_d50(isea) = sed_d50file(ix,iy)
5615  sed_d50(isea) = max(sed_d50(isea),1e-5)
5616  ! Critical Shields number, Soulsby, R.L. and R J S W Whitehouse
5617  ! Threshold of sed. motion in coastal environments, Proc. Pacific Coasts and
5618  ! ports, 1997 conference, Christchurch, p149-154, University of Cantebury, NZ
5619  sed_dstar=(grav*(sed_sg-1)/nu_water**2)**(0.333333)*sed_d50(isea)
5620  sed_psic(isea)=0.3/(1+1.2*sed_dstar)+0.55*(1-exp(-0.02*sed_dstar))
5621 #endif
5622 
5623 
5624 #ifdef W3_BT4
5625  END DO
5626  END DO
5627 #endif
5628  !
5629  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5630  ! 10. Prepare output boundary points.
5631  ! ILOOP = 1 to count NFBPO and NBO
5632  ! ILOOP = 2 to fill data arrays
5633  !
5634  WRITE (ndso,990)
5635  IF ( .NOT. flgnml ) &
5636  OPEN (ndss,file=trim(fnmpre)//'ww3_grid.scratch',form='FORMATTED')
5637  !
5638  DO iloop = 1, 2
5639  !
5640  IF ( iloop.EQ.2 ) CALL w3dmo5 ( 1, ndst, ndse, 2 )
5641  !
5642  i = 1
5643  nbotot = 0
5644  nfbpo = 0
5645  nbo(0) = 0
5646  nbo2(0)= 0
5647  first = .true.
5648  IF ( .NOT. flgnml ) THEN
5649  rewind(ndss)
5650  IF ( iloop .EQ. 1 ) THEN
5651  ndsi2 = ndsi
5652  ELSE
5653  ndsi2 = ndss
5654  END IF
5655  END IF
5656  !
5657  DO
5658  IF (flgnml) THEN
5659  ! outbound lines
5660  IF (nml_outbnd_count%N_LINE.GT.0 .AND. i.LE.nml_outbnd_count%N_LINE) THEN
5661  xo0 = nml_outbnd_line(i)%X0
5662  yo0 = nml_outbnd_line(i)%Y0
5663  dxo = nml_outbnd_line(i)%DX
5664  dyo = nml_outbnd_line(i)%DY
5665  npo = nml_outbnd_line(i)%NP
5666  i=i+1
5667  ELSE
5668  npo=0
5669  END IF
5670  ELSE
5671  CALL nextln ( comstr , ndsi2 , ndse )
5672  READ (ndsi2,*,END=2001,ERR=2002) XO0, YO0, DXO, DYO, npo
5673  END IF
5674  !
5675  IF ( .NOT. flgnml .AND. iloop .EQ. 1 ) THEN
5676  backspace(ndsi)
5677  READ (ndsi,'(A)') line
5678  WRITE (ndss,'(A)') line
5679  END IF
5680  !
5681  ! ... Check if new file to be used
5682  !
5683  first = first .OR. npo.LE.0
5684  npo = abs(npo)
5685  !
5686  ! ... Preparations for new output file including end check
5687  ! and output for last output file
5688  !
5689  IF ( first ) THEN
5690  !
5691  first = .false.
5692  !
5693 #ifdef W3_RTD
5694  IF ( npo.NE.0 ) THEN
5695  ! Destination pole lat, lon from namelist
5696  bpolat = bplat(nfbpo+1)
5697  bpolon = bplon(nfbpo+1)
5698  END IF
5699  !
5700 #endif
5701  IF ( nfbpo.GE.1 .AND. iloop.EQ.2 ) THEN
5702  WRITE (ndso,991) nfbpo, nbo(nfbpo) - nbo(nfbpo-1), &
5703  nbo2(nfbpo) - nbo2(nfbpo-1)
5704 #ifdef W3_RTD
5705  ! Print dest. Pole lat/lon if either the dest or present grid is rotated
5706  IF ( bplat(nfbpo) < 90. .OR. polat < 90. ) &
5707  WRITE (ndso,1991) bplat(nfbpo), bplon(nfbpo)
5708  !
5709 #endif
5710 #ifdef W3_O1
5711  IF ( nbo(nfbpo) - nbo(nfbpo-1) .EQ. 1 ) THEN
5712  IF ( flagll ) THEN
5713  WRITE (ndso,992)
5714  ELSE
5715  WRITE (ndso,2992)
5716  END IF
5717  ELSE
5718  IF ( flagll ) THEN
5719  WRITE (ndso,1992)
5720  ELSE
5721  WRITE (ndso,3992)
5722  END IF
5723  END IF
5724  ip0 = nbo(nfbpo-1)+1
5725  ipn = nbo(nfbpo)
5726  iph = ip0 + (ipn-ip0-1)/2
5727  ipi = iph -ip0 + 1 + mod(ipn-ip0+1,2)
5728  DO ip=ip0, iph
5729  IF ( flagll ) THEN
5730  WRITE (ndso,1993) ip-nbo(nfbpo-1), &
5731  factor*xbpo(ip), &
5732  factor*ybpo(ip), &
5733  ip+ipi-nbo(nfbpo-1), &
5734  factor*xbpo(ip+ipi), &
5735  factor*ybpo(ip+ipi)
5736  ELSE
5737  WRITE (ndso,3993) ip-nbo(nfbpo-1), &
5738  factor*xbpo(ip), &
5739  factor*ybpo(ip), &
5740  ip+ipi-nbo(nfbpo-1), &
5741  factor*xbpo(ip+ipi), &
5742  factor*ybpo(ip+ipi)
5743  END IF
5744  END DO
5745  IF ( mod(ipn-ip0+1,2) .EQ. 1 ) THEN
5746  IF ( flagll ) THEN
5747  WRITE (ndso, 993) iph+1-nbo(nfbpo-1), &
5748  factor*xbpo(iph+1), &
5749  factor*ybpo(iph+1)
5750  ELSE
5751  WRITE (ndso,2993) iph+1-nbo(nfbpo-1), &
5752  factor*xbpo(iph+1), &
5753  factor*ybpo(iph+1)
5754  END IF
5755  END IF
5756  WRITE (ndso,*)
5757 #endif
5758  END IF
5759  !
5760  IF ( npo .EQ. 0 ) EXIT
5761  !
5762  nfbpo = nfbpo + 1
5763  IF ( nfbpo .GT. 9 ) THEN
5764  WRITE (ndse,1006)
5765  CALL extcde ( 50 )
5766  END IF
5767  nbo2(nfbpo) = nbo2(nfbpo-1)
5768  nbo(nfbpo) = nbotot
5769  !
5770  END IF
5771  !
5772  ! ... Loop over line segment - - - - - - - - - - - - - - - - - - - - -
5773  !
5774 #ifdef W3_RTD
5775  ! If either base or destination grid is rotated lat-lon
5776  IF ( allocated(bdylon) .eqv. .true. ) THEN
5777  deallocate( bdylon, bdylat )
5778  IF ( bpolat < 90. .OR. polat < 90. ) &
5779  deallocate( elatbdy, elonbdy, anglbdy )
5780  END IF
5781  allocate( bdylon(npo), bdylat(npo))
5782  IF ( bpolat < 90. .OR. polat < 90. ) &
5783  allocate( elatbdy(npo), elonbdy(npo), anglbdy(npo) )
5784  !
5785 #endif
5786 #ifdef W3_T
5787  WRITE (ndst,9090)
5788 #endif
5789  !
5790  DO ip=1, npo
5791  !
5792  xo = xo0 + real(ip-1)*dxo
5793  yo = yo0 + real(ip-1)*dyo
5794 #ifdef W3_RTD
5795  !
5796  ! Boundary points are specified in coordinates of the destination grid
5797  !
5798  ! Collect the line segment points into arrays
5799  bdylon(ip) = xo
5800  bdylat(ip) = yo
5801  ! Close the loop before calculating rotated lat-lon coordinates.
5802  END DO
5803 
5804  ! Create one or two sets of the segment points:
5805  ! 1. (BDYLAT, BDYLON) in standard lat-lon coordinates,
5806  ! 2. Also (ELatbdy, ELonbdy) in case the base grid is rotated
5807 
5808  IF ( bpolat < 90. ) THEN
5809  ! The destination grid is rotated (std->rot or rot->rot)
5810  ! Change BDYLAT, BDYLON to their standard lat-lon positions
5811  ! Let ELatbdy,ELonbdy contain the rotated lat-lon coordinates
5812  elatbdy(:) = bdylat(:)
5813  elonbdy(:) = bdylon(:)
5814  CALL w3eqtoll ( elatbdy, elonbdy, bdylat, bdylon, &
5815  & anglbdy, bpolat, bpolon, npo )
5816  ! Let the standard longitudes BDYLON be within the range [-180.,180.[
5817  ! or [0., 360.[ depending on the grid pole
5818  IF ( polon < -90. .OR. polon > 90. ) THEN
5819  bdylon(:) = mod( bdylon(:) + 180., 360. ) - 180.
5820  ELSE
5821  bdylon(:) = mod( bdylon(:) + 360., 360. )
5822  END IF
5823  END IF ! bPolat < 90.
5824  ! From now, BDYLAT, BDYLON are defined in standard lat-lon coordinates
5825  !
5826  IF ( polat < 90. ) THEN
5827  ! The base grid is rotated (rot->std or rot->rot)
5828  ! Find lat-lon in coordinates of the rotated base grid
5829  CALL w3lltoeq ( bdylat, bdylon, elatbdy, elonbdy, &
5830  & anglbdy, polat, polon, npo )
5831  END IF
5832  !
5833  ! Take up again the loop over the line segment points
5834  DO ip=1, npo
5835  IF ( polat < 90. ) THEN
5836  ! The base grid is rotated (rot->std, rot->rot)
5837  ! (The std. lat-lon values BDYLAT, BDYLON go to YBPO, XBPO)
5838  xo = elonbdy(ip)
5839  yo = elatbdy(ip)
5840  ELSE
5841  ! The base grid is standard geographic (std->rot or std->std)
5842  xo = bdylon(ip)
5843  yo = bdylat(ip)
5844  END IF
5845 #endif
5846  !
5847  ! ... Compute bilinear remapping weights
5848  !
5849  ingrid = w3grmp( gsu, xo, yo, ixr, iyr, rd )
5850  !
5851  ! Change cell-corners from counter-clockwise to column-major order
5852  ix = ixr(3); iy = iyr(3); x = rd(3);
5853  ixr(3) = ixr(4); iyr(3) = iyr(4); rd(3) = rd(4);
5854  ixr(4) = ix ; iyr(4) = iy ; rd(4) = x ;
5855  !
5856 #ifdef W3_T
5857  WRITE (ndst,9091) factor*xo, factor*yo, &
5858  (ixr(j), iyr(j), rd(j), j=1,4)
5859 #endif
5860  !
5861  ! ... Check if point in grid
5862  !
5863  IF ( ingrid ) THEN
5864  !
5865  ! ... Check if point not on land
5866  !
5867  IF ( ( mapsta(iyr(1),ixr(1)).GT.0 .AND. &
5868  rd(1).GT.0.05 ) .OR. &
5869  ( mapsta(iyr(2),ixr(2)).GT.0 .AND. &
5870  rd(2).GT.0.05 ) .OR. &
5871  ( mapsta(iyr(3),ixr(3)).GT.0 .AND. &
5872  rd(3).GT.0.05 ) .OR. &
5873  ( mapsta(iyr(4),ixr(4)).GT.0 .AND. &
5874  rd(4).GT.0.05 ) ) THEN
5875  !
5876  ! ... Check storage and store coordinates
5877  !
5878  nbotot = nbotot + 1
5879  IF ( iloop .EQ. 1 ) cycle
5880  !
5881 #ifdef W3_RTD
5882  ! BDYLAT, BDYLON contain Y0, X0, which are remapped to standard lat/lon.
5883  ! BDYLAT, BDYLON are stored in the mod_def file.
5884  IF ( polat < 90. ) THEN
5885  xo = bdylon(ip)
5886  yo = bdylat(ip)
5887  END IF
5888 #endif
5889  xbpo(nbotot) = xo
5890  ybpo(nbotot) = yo
5891  !
5892  ! ... Interpolation factors
5893  !
5894  rdtot = 0.
5895  DO j=1, 4
5896  IF ( mapsta(iyr(j),ixr(j)).GT.0 .AND. &
5897  rd(j).GT.0.05 ) THEN
5898  rdbpo(nbotot,j) = rd(j)
5899  ELSE
5900  rdbpo(nbotot,j) = 0.
5901  END IF
5902  rdtot = rdtot + rdbpo(nbotot,j)
5903  END DO
5904  !
5905  DO j=1, 4
5906  rdbpo(nbotot,j) = rdbpo(nbotot,j) / rdtot
5907  END DO
5908  !
5909 #ifdef W3_T
5910  WRITE (ndst,9092) rdtot, (rdbpo(nbotot,j),j=1,4)
5911 #endif
5912  !
5913  ! ... Determine sea and interpolation point counters
5914  !
5915  DO j=1, 4
5916  iseai(j) = mapfs(iyr(j),ixr(j))
5917  END DO
5918  !
5919  DO j=1, 4
5920  IF ( iseai(j).EQ.0 .OR. rdbpo(nbotot,j).EQ. 0. ) THEN
5921  ipbpo(nbotot,j) = 0
5922  ELSE
5923  flnew = .true.
5924  DO ist=nbo2(nfbpo-1)+1, nbo2(nfbpo)
5925  IF ( iseai(j) .EQ. isbpo(ist) ) THEN
5926  flnew = .false.
5927  ipbpo(nbotot,j) = ist - nbo2(nfbpo-1)
5928  END IF
5929  END DO
5930  IF ( flnew ) THEN
5931  nbo2(nfbpo) = nbo2(nfbpo) + 1
5932  ipbpo(nbotot,j) = nbo2(nfbpo) - nbo2(nfbpo-1)
5933  isbpo(nbo2(nfbpo)) = iseai(j)
5934  END IF
5935  END IF
5936  END DO
5937  !
5938 #ifdef W3_T
5939  WRITE (ndst,9093) iseai, (ipbpo(nbotot,j),j=1,4)
5940 #endif
5941  !
5942  ! ... Error output
5943  !
5944  ELSE
5945  IF ( flagll ) THEN
5946  WRITE (ndse,2995) factor*xo, factor*yo
5947  ELSE
5948  WRITE (ndse,995) factor*xo, factor*yo
5949  END IF
5950  END IF
5951  ELSE
5952  IF ( flagll ) THEN
5953  WRITE (ndse,2994) factor*xo, factor*yo
5954  ELSE
5955  WRITE (ndse,994) factor*xo, factor*yo
5956  END IF
5957  END IF
5958  !
5959  END DO
5960  !
5961  nbo(nfbpo) = nbotot
5962  !
5963  ! ... Branch back to read.
5964  !
5965  END DO
5966  !
5967  ! ... End of ILOOP loop
5968  !
5969  END DO
5970  !
5971  IF ( .NOT. flgnml ) CLOSE ( ndss, status='DELETE' )
5972  !
5973  flbpo = nbotot .GT. 0
5974  IF ( .NOT. flbpo ) THEN
5975  WRITE (ndso,996)
5976  ELSE
5977  WRITE (ndso,997) nbotot, nbo2(nfbpo)
5978  END IF
5979  !
5980 #ifdef W3_T0
5981  WRITE (ndst,9095)
5982  DO ifile=1, nfbpo
5983  DO ip=nbo2(ifile-1)+1, nbo2(ifile)
5984  WRITE (ndst,9096) ifile, ip-nbo2(ifile-1), isbpo(ip)
5985  END DO
5986  END DO
5987 #endif
5988  !
5989  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5990  !10. Write model definition file.
5991  !
5992  WRITE (ndso,999)
5993  CALL w3iogr ( 'WRITE', ndsm &
5994 #ifdef W3_ASCII
5995  ,ndsa=ndsma &
5996 #endif
5997  )
5998  !
5999  CLOSE (ndsm)
6000 #ifdef W3_ASCII
6001  CLOSE (ndsma)
6002 #endif
6003  !
6004  GOTO 2222
6005  !
6006  ! Escape locations read errors :
6007  !
6008 2000 CONTINUE
6009  WRITE (ndse,1000) ierr
6010  CALL extcde ( 60 )
6011  !
6012 2001 CONTINUE
6013  WRITE (ndse,1001)
6014  CALL extcde ( 61 )
6015  !
6016 2002 CONTINUE
6017  WRITE (ndse,1002) ierr
6018  CALL extcde ( 62 )
6019  !
6020 2003 CONTINUE
6021  WRITE (ndse,1003)
6022  CALL extcde ( 64 )
6023  !
6024 2222 CONTINUE
6025  IF ( gtype .NE. ungtype) THEN
6026  IF ( nx*ny .NE. nsea ) THEN
6027  WRITE (ndso,9997) nx, ny, nx*ny, nsea, &
6028  100.*real(nsea)/real(nx*ny), nbi, nland, nbt
6029  ELSE
6030  WRITE (ndso,9998) nx, ny, nx*ny, nsea, nbi, nland, nbt
6031  END IF
6032  ELSE IF ( gtype .EQ. ungtype ) THEN
6033  IF ( nx*ny .NE. nsea ) THEN
6034  WRITE (ndso,9997) 0, 0, nx*ny, nsea, &
6035  100.*real(nsea)/real(nx*ny), nbi, nland, nbt
6036  ELSE
6037  WRITE (ndso,9998) 0, 0, nx*ny, nsea, nbi, nland, nbt
6038  END IF
6039  ENDIF ! GTYPE .EQ. UNGTYPE
6040 
6041  WRITE (ndso,9999)
6042 
6043 #ifdef W3_SCRIP
6044  grid1_units='degrees' ! the other option is radians...we don't use this
6045  grid1_name='src' ! this is not used, except for netcdf output
6046  CALL get_scrip_info(1, &
6050 
6051 
6052 #endif
6053 
6054 #ifdef W3_SCRIP
6055  IF (gtype .EQ. ungtype) THEN
6056  grid1_rank=1
6057  DEALLOCATE(grid1_dims)
6058  ALLOCATE(grid1_dims(grid1_rank))
6059  grid1_dims(1) = grid1_size
6060  ENDIF
6061 #endif
6062 
6063 #ifdef W3_SCRIP
6064  DO i = 1,grid1_size
6065  IF (grid1_center_lon(i) < 0.0) THEN
6066  grid1_center_lon(i) = grid1_center_lon(i)+360.0
6067  ENDIF
6068  DO j = 1,grid1_corners
6069  IF (grid1_corner_lon(j,i) < 0.0) THEN
6070  grid1_corner_lon(j,i) = grid1_corner_lon(j,i)+360.0
6071  ENDIF
6072  ENDDO
6073  ENDDO
6074 #endif
6075 
6076 #ifdef W3_SCRIPNC
6077  ierr = nf90_create(trim('scrip.nc'), nf90_netcdf4, ncid)
6078  ierr = nf90_def_dim(ncid, 'grid_size', grid1_size, grid_size_dimid)
6079  ierr = nf90_def_dim(ncid, 'grid_corners', grid1_corners, grid_corners_dimid)
6080  ierr = nf90_def_dim(ncid, 'grid_rank', grid1_rank, grid_rank_dimid)
6081 #endif
6082 
6083 #ifdef W3_SCRIPNC
6084  ierr = nf90_def_var(ncid, 'grid_center_lat', nf90_double, &
6085  (/grid_size_dimid/),grid_center_lat_varid)
6086  ierr = nf90_def_var(ncid, 'grid_center_lon', nf90_double, &
6087  (/grid_size_dimid/),grid_center_lon_varid)
6088  ierr = nf90_def_var(ncid, 'grid_corner_lat', nf90_double, &
6089  (/grid_corners_dimid,grid_size_dimid/), &
6090  grid_corner_lat_varid)
6091  ierr = nf90_def_var(ncid, 'grid_corner_lon', nf90_double, &
6092  (/grid_corners_dimid,grid_size_dimid/), &
6093  grid_corner_lon_varid)
6094  ierr = nf90_def_var(ncid, 'grid_imask', nf90_int, &
6095  (/grid_size_dimid/),grid_imask_varid)
6096  ierr = nf90_def_var(ncid, 'grid_dims', nf90_int, &
6097  (/grid_rank_dimid/),grid_dims_varid)
6098  ierr = nf90_enddef(ncid)
6099 #endif
6100 
6101 #ifdef W3_SCRIP
6102  ALLOCATE(grid1_imask(grid1_dims(1)))
6103  grid1_imask = 0
6104  DO i = 1,grid1_dims(1)
6105  IF (grid1_mask(i)) THEN
6106  grid1_imask(i) = 1
6107  ENDIF
6108  ENDDO
6109 #endif
6110 
6111 #ifdef W3_SCRIPNC
6112  ierr = nf90_put_att(ncid,grid_center_lat_varid,'units',grid1_units)
6113  ierr = nf90_put_att(ncid,grid_center_lon_varid,'units',grid1_units)
6114  ierr = nf90_put_att(ncid,grid_corner_lat_varid,'units',grid1_units)
6115  ierr = nf90_put_att(ncid,grid_corner_lon_varid,'units',grid1_units)
6116  ierr = nf90_put_att(ncid,grid_imask_varid,'units','unitless')
6117 #endif
6118 
6119 #ifdef W3_SCRIPNC
6120  ierr = nf90_put_var(ncid,grid_center_lat_varid,grid1_center_lat)
6121  ierr = nf90_put_var(ncid,grid_center_lon_varid,grid1_center_lon)
6122  ierr = nf90_put_var(ncid,grid_corner_lat_varid,grid1_corner_lat)
6123  ierr = nf90_put_var(ncid,grid_corner_lon_varid,grid1_corner_lon)
6124  ierr = nf90_put_var(ncid,grid_imask_varid,grid1_imask)
6125  ierr = nf90_put_var(ncid,grid_dims_varid,grid1_dims)
6126  ierr = nf90_close(ncid)
6127 #endif
6128 
6129 
6130  !
6131  ! Formats
6132  !
6133 900 FORMAT (/15x,' *** WAVEWATCH III Grid preprocessor *** '/ &
6134  15x,'==============================================='/)
6135 901 FORMAT ( ' Comment character is ''',a,''''/)
6136 902 FORMAT ( ' Grid name : ',a/)
6137 903 FORMAT (/' Spectral discretization : '/ &
6138  ' --------------------------------------------------'/ &
6139  ' Number of directions :',i4/ &
6140  ' Directional increment (deg.):',f6.1)
6141 904 FORMAT ( ' First direction (deg.):',f6.1)
6142 905 FORMAT ( ' Number of frequencies :',i4/ &
6143  ' Frequency range (Hz) :',f9.4,'-',f6.4/ &
6144  ' Increment factor :',f8.3/)
6145  !
6146 910 FORMAT (/' Model definition :'/ &
6147  ' --------------------------------------------------')
6148 911 FORMAT ( ' Dry run (no calculations) : ',a/ &
6149  ' Propagation in X-direction : ',a/ &
6150  ' Propagation in Y-direction : ',a/ &
6151  ' Refraction : ',a/ &
6152  ' Current-induced k-shift : ',a/ &
6153  ' Source term calc. and int. : ',a/)
6154 912 FORMAT (/' Time steps : '/ &
6155  ' --------------------------------------------------'/ &
6156  ' Maximum global time step (s) :',f8.2/ &
6157  ' Maximum CFL time step X-Y (s) :',f8.2/ &
6158  ' Maximum CFL time step k-theta (s) :',f8.2/ &
6159  ' Minimum source term time step (s) :',f8.2/)
6160 913 FORMAT (/ ' WARNING, TIME STEP LESS THAN 1 s, NITER:',i8 /)
6161 915 FORMAT ( ' Preprocessing namelists ...')
6162 916 FORMAT ( ' Preprocessing namelists finished.'/)
6163 917 FORMAT (/' Equivalent namelists ...'/)
6164 918 FORMAT (/' Equivalent namelists finished.'/)
6165  !
6166 #ifdef W3_FLX1
6167 810 FORMAT (/' Stresses (Wu 1980)'/ &
6168  ' --------------------------------------------------'/)
6169 #endif
6170 #ifdef W3_FLX2
6171 810 FORMAT (/' Stresses (T&C 96)'/ &
6172  ' --------------------------------------------------'/)
6173 #endif
6174 #ifdef W3_FLX3
6175 810 FORMAT (/' Stresses (T&C 96 capped) ',a/ &
6176  ' --------------------------------------------------')
6177 #endif
6178 #ifdef W3_FLX4
6179 810 FORMAT (/' Stresses (Hwang 2011) ',a/ &
6180  ' --------------------------------------------------')
6181 811 FORMAT ( ' drag coefficient scaling :',f8.2 /)
6182 2810 FORMAT ( ' &FLX4 CDFAC =',f6.3,' /')
6183 #endif
6184 #ifdef W3_FLX5
6185 810 FORMAT (/' Direct use of stress from input'/ &
6186  ' --------------------------------------------------'/)
6187 #endif
6188 #ifdef W3_FLX3
6189 811 FORMAT ( ' Max Cd * 10^3 :',f8.2/ &
6190  ' Cap type : ',a/)
6191 2810 FORMAT ( ' &FLX3 CDMAX =',f6.2,'E-3 , CTYPE = ',i1,' /')
6192 #endif
6193  !
6194 #ifdef W3_LN0
6195 820 FORMAT (/' Linear input not defined.'/)
6196 #endif
6197 #ifdef W3_SEED
6198 820 FORMAT (/' Seeding as proxi for linear input.'/)
6199 #endif
6200  !
6201 #ifdef W3_LN1
6202 820 FORMAT (/' Linear input (C&M-R 82) ',a/ &
6203  ' --------------------------------------------------')
6204 821 FORMAT ( ' CLIN :',f8.2/ &
6205  ' Factor for fPM in filter :',f8.2/ &
6206  ' Factor for fh in filter :',f8.2/)
6207 2820 FORMAT ( ' &SLN1 CLIN =',f6.1,', RFPM =',f6.2, &
6208  ', RFHF =',f6.2,' /')
6209 #endif
6210  !
6211 #ifdef W3_ST0
6212 920 FORMAT (/' Wind input not defined.'/)
6213 #endif
6214  !
6215 #ifdef W3_ST1
6216 920 FORMAT (/' Wind input (WAM-3) ',a/ &
6217  ' --------------------------------------------------')
6218 921 FORMAT ( ' Cinp :',e10.3/)
6219 2920 FORMAT ( ' &SIN1 CINP =',f7.3,' /')
6220 #endif
6221  !
6222 #ifdef W3_ST2
6223 920 FORMAT (/' Wind input (T&C 1996) ',a/ &
6224  ' --------------------------------------------------')
6225 921 FORMAT ( ' Height of input wind (m) :',f8.2/ &
6226  ' Factor negative swell :',f9.3/)
6227 #endif
6228 #ifdef W3_STAB2
6229 1921 FORMAT ( ' Effective wind mean factor :',f8.2/ &
6230  ' Stability par. offset :',f9.3/ &
6231  ' Stab. correction :',f9.3,f8.3/&
6232  ' Stab. correction stab. fac. :',f7.1,f9.1/)
6233 #endif
6234 #ifdef W3_ST2
6235 2920 FORMAT ( ' &SIN2 ZWND =',f5.1,', SWELLF =',f6.3,' /')
6236 #endif
6237 #ifdef W3_STAB2
6238 2921 FORMAT ( ' &SIN2 ZWND =',f5.1,', SWELLF =',f6.3,', STABSH =', &
6239  f6.3,', STABOF = ',e10.3,','/ &
6240  ' CNEG =',f7.3,', CPOS =',f7.3,', FNEG =',f7.1,' /')
6241 #endif
6242  !
6243 #ifdef W3_ST3
6244 920 FORMAT (/' Wind input (WAM 4+) ',a/ &
6245  ' --------------------------------------------------')
6246 921 FORMAT ( ' minimum Charnock coeff. :',f10.4/ &
6247  ' betamax :',f9.3/ &
6248  ' power of cos. in wind input :',f9.3/ &
6249  ' z0max :',f9.3/ &
6250  ' zalp :',f9.3/ &
6251  ' Height of input wind (m) :',f8.2/ &
6252  ' swell attenuation factor :',f9.3/ )
6253 2920 FORMAT ( ' &SIN3 ZWND =',f5.1,', ALPHA0 =',f8.5,', Z0MAX =',f8.5,', BETAMAX =', &
6254  f8.5,','/ &
6255  ' SINTHP =',f8.5,', ZALP =',f8.5,','/ &
6256  ' SWELLF =',f8.5,'R /'/)
6257 #endif
6258  !
6259 #ifdef W3_ST4
6260 920 FORMAT (/' Wind input (WAM 4+) ',a/ &
6261  ' --------------------------------------------------')
6262 921 FORMAT ( ' minimum Charnock coeff. :',f10.4/ &
6263  ' betamax :',f9.3/ &
6264  ' power of cos. in wind input :',f9.3/ &
6265  ' z0max :',f9.3/ &
6266  ' zalp :',f9.3/ &
6267  ' Height of input wind (m) :',f8.2/ &
6268  ' wind stress sheltering :',f9.3/ &
6269  ' swell attenuation param. :',i5/ &
6270  ' swell attenuation factor :',f9.3/ &
6271  ' swell attenuation factor2 :',f9.3/ &
6272  ' swell attenuation factor3 :',f9.3/ &
6273  ' critical Reynolds number :',f9.1/ &
6274  ' swell attenuation factor5 :',f9.3/ &
6275  ' swell attenuation factor6 :',f9.3/ &
6276  ' swell attenuation factor7 :',f14.3/ &
6277  ' ratio of z0 for orb. & mean :',f9.3/)
6278 2920 FORMAT ( ' &SIN4 ZWND =',f5.1,', ALPHA0 =',f8.5,', Z0MAX =',f8.5,', BETAMAX =', &
6279  f8.5,','/ &
6280  ' SINTHP =',f8.5,', ZALP =',f8.5,', TAUWSHELTER =',f8.5, &
6281  ', SWELLFPAR =',i2,','/ &
6282  ' SWELLF =',f8.5,', SWELLF2 =',f8.5, &
6283  ', SWELLF3 =',f8.5,', SWELLF4 =',f9.1,','/ &
6284  ' SWELLF5 =',f8.5,', SWELLF6 =',f8.5, &
6285  ', SWELLF7 =',f12.2,', Z0RAT =',f8.5,', SINBR =',f8.5,','/ &
6286  ' SINTABLE =',i2,', TAUWBUG =',i2, &
6287  ', VISCSTRESS =',f8.5,', SINTAIL1 =',f8.5,', SINTAIL2 =',f8.5,',' / &
6288  ', CAPCHA =',f8.5,', CHAMIN =',f8.5,', CHA0 =',f8.5,', UCAP =',f5.1,', SIGMAUCAP =', &
6289  f5.1,' /')
6290 #endif
6291  !
6292 #ifdef W3_ST6
6293 920 FORMAT (/' Wind input (Donelan et al, 2006) ',a/ &
6294  ' --------------------------------------------------')
6295 921 FORMAT ( ' negative wind input active : ',a/ &
6296  ' attenuation factor : ',f6.2/ &
6297  ' wind speed scaling factor : ',f6.2/ &
6298  ' frequency cut-off factor : ',f6.2/)
6299 2920 FORMAT ( ' &SIN6 SINA0 =', f6.3, ', SINWS =', f6.2, ', SINFC =', f6.2, ' /')
6300 #endif
6301  !
6302 #ifdef W3_NL0
6303 922 FORMAT (/' Nonlinear interactions not defined.'/)
6304 #endif
6305  !
6306 #ifdef W3_NL1
6307 922 FORMAT (/' Nonlinear interactions (DIA) ',a/ &
6308  ' --------------------------------------------------')
6309 923 FORMAT ( ' Lambda :',f8.2/ &
6310  ' Prop. constant :',e10.3/ &
6311  ' kd conversion factor :',f8.2/ &
6312  ' minimum kd :',f8.2/ &
6313  ' shallow water constants :',f8.2,2f6.2/)
6314 2922 FORMAT ( ' &SNL1 LAMBDA =',f7.3,', NLPROP =',e10.3, &
6315  ', KDCONV =',f7.3,', KDMIN =',f7.3,','/ &
6316  ' SNLCS1 =',f7.3,', SNLCS2 =',f7.3, &
6317  ', SNLCS3 = ',f7.3','/ &
6318  ' IQTYPE =',i2,', TAILNL =',f5.1,','/ &
6319  ' GQMNF1 =',i2,', GQMNT1 =',i2,',', &
6320  ' GQMNQ_OM2 =',i2,', GQMTHRSAT =',e11.4,', GQMTHRCOU =',f4.3,','/ &
6321  ' GQAMP1 =',f5.3,', GQAMP2 =',f5.3,', GQAMP3 =',f5.3,', GQAMP4 =',f5.3,' /')
6322 #endif
6323  !
6324 #ifdef W3_NL2
6325 922 FORMAT (/' Nonlinear interactions (WRT) ',a/ &
6326  ' --------------------------------------------------')
6327 923 FORMAT ( ' Deep/shallow options : ',a/ &
6328  ' Power of h-f tail : ',f6.1)
6329 1923 FORMAT ( ' Number of depths used : ',i4/ &
6330  ' Depths (m) :',5f7.1)
6331 2923 FORMAT ( ' ',5f7.1)
6332 2922 FORMAT ( ' &SNL2 IQTYPE =',i2,', TAILNL =',f5.1,',', &
6333  ' NDEPTH =',i3,' /')
6334 3923 FORMAT ( ' &SNL2 DEPTHS =',f9.2,' /')
6335 4923 FORMAT ( ' &ANL2 DEPTHS =',f9.2,' ,')
6336 5923 FORMAT ( ' ',f9.2,' ,')
6337 6923 FORMAT ( ' ',f9.2,' /')
6338 #endif
6339  !
6340 #ifdef W3_NL3
6341 922 FORMAT (/' Nonlinear interactions (GMD) ',a/ &
6342  ' --------------------------------------------------')
6343 923 FORMAT ( ' Powers in scaling functions : ',2f7.2/ &
6344  ' Nondimension filter depths : ',2f7.2)
6345 1923 FORMAT ( ' Number of quad. definitions : ',i4)
6346 2923 FORMAT ( ' ',2f8.3,f6.1,2e12.4)
6347 2922 FORMAT ( ' &SNL3 NQDEF =',i3,', MSC =',f6.2,', NSC =', &
6348  f6.2,', KDFD =',f6.2,', KDFS =',f6.2,' /')
6349 3923 FORMAT ( ' &ANL3 QPARMS = ',2(f5.3,', '),f5.1,', ',e11.4, &
6350  ', ',e11.4,' /')
6351 4923 FORMAT ( ' &ANL3 QPARMS = ',2(f5.3,', '),f5.1,', ',e11.4, &
6352  ', ',e11.4,' ,')
6353 5923 FORMAT ( ' ',2(f5.3,', '),f5.1,', ',e11.4, &
6354  ', ',e11.4,' ,')
6355 6923 FORMAT ( ' ',2(f5.3,', '),f5.1,', ',e11.4, &
6356  ', ',e11.4,' /')
6357 #endif
6358  !
6359 #ifdef W3_NL4
6360 922 FORMAT (/' Nonlinear interactions (TSA) ',a/ &
6361  ' --------------------------------------------------')
6362 923 FORMAT ( ' Source term computation (1=TSA,0=FBI) : ',i2/ &
6363  ' Alternate loops (1=no,2=yes) : ',i2/ &
6364  ' (To speed up computation) ')
6365 2922 FORMAT ( ' &SNL4 ITSA =',i2,', IALT =',i2 )
6366 #endif
6367  !
6368 #ifdef W3_NL5
6369 922 FORMAT(/' Nonlinear interactions (GKE) ',a/ &
6370  ' --------------------------------------------------')
6371 923 FORMAT ( ' Constant water depth (in meter) : ', f7.1/ &
6372  ' Quasi-resonant quartets cut-off : ', f8.2/ &
6373  ' Discretiz. of GKE (0:Con., 1:GS): ', i5/ &
6374  ' GKE (0: GS13-JFM, 1: J03-JPO) : ', i5/ &
6375  ' Interp (0: nearest, 1: bilinear): ', i5/ &
6376  ' Mixing (0: no, N: N Tm, -1: b_T): ', i5/)
6377 2922 FORMAT ( ' &SNL5 NL5DPT =', f7.1, ', NL5OML =', f5.2, &
6378  ', NL5DIS =', i2.1, ', NL5KEV =', i2.1, &
6379  ', NL5IPL =', i2.1, ', NL5PMX =', i5.1, ' /')
6380 #endif
6381  !
6382 #ifdef W3_NLS
6383 9922 FORMAT (/' HF filter based on Snl ',a/ &
6384  ' --------------------------------------------------')
6385 9923 FORMAT ( ' a34 (lambda) :',f9.3,f9.4/ &
6386  ' Prop. constant :',e10.3/ &
6387  ' maximum relative change :',f9.3/ &
6388  ' filter constants :',f8.2,2f6.2/)
6389 8922 FORMAT ( ' &SNLS A34 =',f6.3,', FHFC =',e11.4, &
6390  ', DNM =',f6.3,','/' FC1 =',f6.3, &
6391  ', FC2 =',f6.3,', FC3 =',f6.3,' /')
6392 #endif
6393  !
6394 #ifdef W3_ST0
6395 924 FORMAT (/' Dissipation not defined.'/)
6396 #endif
6397  !
6398 #ifdef W3_ST1
6399 924 FORMAT (/' Dissipation (WAM-3) ',a/ &
6400  ' --------------------------------------------------')
6401 925 FORMAT ( ' Cdis :',e10.3/ &
6402  ' Apm :',e10.3/)
6403 2924 FORMAT ( ' &SDS1 CDIS =',e12.4,', APM =',e11.4,' /')
6404 #endif
6405  !
6406 #ifdef W3_ST2
6407 924 FORMAT (/' Dissipation (T&C 1996) ',a/ &
6408  ' --------------------------------------------------')
6409 925 FORMAT ( ' High-frequency constants :',f8.2,e11.3,f6.2/ &
6410  ' Low-frequency constants :',e11.3,f6.2/&
6411  ' ',e11.3,f6.2/&
6412  ' Minimum input peak freq. (-):',f10.4/ &
6413  ' Minimum PHI :',f10.4/)
6414 2924 FORMAT ( ' &SDS2 SDSA0 =',e10.3,', SDSA1 =',e10.3,', SDSA2 =', &
6415  e10.3,', '/ &
6416  ' SDSB0 =',e10.3,', SDSB1 =',e10.3,', ', &
6417  'PHIMIN =',e10.3,' /')
6418 #endif
6419  !
6420 #ifdef W3_ST3
6421 924 FORMAT (/' Dissipation (WAM Cycle 4+) ',a/ &
6422  ' --------------------------------------------------')
6423 925 FORMAT ( ' SDSC1 :',1e11.3/ &
6424  ' Power of k in mean k :',f8.2/ &
6425  ' weights of k and k^2 :',f9.3,f6.3/)
6426 2924 FORMAT ( ' &SDS3 SDSC1 =',e12.4,', WNMEANP =',f4.2, &
6427  ', FXPM3 =', f4.2,',FXFM3 =',f4.2,', '/ &
6428  ' SDSDELTA1 =', f5.2,', SDSDELTA2 =',f5.2, &
6429  ' /')
6430 #endif
6431  !
6432 #ifdef W3_ST4
6433 924 FORMAT (/' Dissipation (Ardhuin / Filipot / Romero ) ',a/ &
6434  ' --------------------------------------------------')
6435 925 FORMAT ( ' SDSC2, SDSBCK, SDSCUM :',3e11.3/ &
6436  ' Power of k in mean k :',f8.2/)
6437 #endif
6438 
6439 
6440 #ifdef W3_ST4
6441 2924 FORMAT ( ' &SDS4 SDSBCHOICE = ',f3.1, &
6442  ', SDSC2 =',e12.4,', SDSCUM =',f6.2,', '/ &
6443  ' SDSC4 =',f6.2,', SDSC5 =',e12.4, &
6444  ', SDSC6 =',e12.4,','/ &
6445  ' WNMEANP =',f4.2,', FXPM3 =', f4.2, &
6446  ', FXFM3 =',f4.1,', FXFMAGE =',f6.3, ', '/ &
6447  ' SDSBINT =',e12.4,', SDSBCK =',e12.4, &
6448  ', SDSABK =',f6.3,', SDSPBK =',f6.3,', '/ &
6449  ' SDSHCK =',f5.2,', SDSBR = ',e12.4, &
6450  ', SDSSTRAIN =',f5.1,', SDSSTRAINA =',f4.1, &
6451  ', SDSSTRAIN2 =',f5.1,', '/ &
6452  ' SDSBT =',f5.2,', SDSP =',f5.2, &
6453  ', SDSISO =',i2, &
6454  ', SDSCOS =',f3.1,', SDSDTH =',f5.1,', '/ &
6455  ' SDSBRF1 = ',f5.2,', SDSBRFDF =',i2,', '/ &
6456  ' SDSBM0 = ',f5.2, ', SDSBM1 =',f5.2, &
6457  ', SDSBM2 =',f5.2,', SDSBM3 =',f5.2,', SDSBM4 =', &
6458  f7.2,', '/, &
6459  ' SPMSS = ',f5.2, ', SDKOF =',f5.2, &
6460  ', SDSMWD =',f5.2,', SDSFACMTF =',f5.1,', '/ &
6461  ' SDSMWPOW =',f3.1,', SDSNMTF =', f5.2, &
6462  ', SDSCUMP =', f3.1,', CUMSIGP =', f3.1,', SDSNUW =', e10.3,', '/, &
6463  ' WHITECAPWIDTH =',f5.2, ' WHITECAPDUR =',f5.2,' /')
6464 #endif
6465  !
6466 #ifdef W3_ST6
6467 924 FORMAT (/' Dissipation (Rogers et al. 2012) ',a/ &
6468  ' --------------------------------------------------')
6469 925 FORMAT ( ' normalise by threshold spectral density : ',a/&
6470  ' normalise by spectral density : ',a/&
6471  ' coefficient and exponent for '/ &
6472  ' inherent breaking term a1, L as in (21) : ',e10.3,i3/ &
6473  ' cumulative breaking term a2, M as in (22) : ',e10.3,i3/ &
6474  ' ')
6475 2924 FORMAT ( ' &SDS6 SDSET = ',l,', SDSA1 = ',e10.3, &
6476  ', SDSA2 = ',e10.3,', SDSP1 = ',i2,', SDSP1 = ', &
6477  i2,' /' )
6478 
6479 937 FORMAT (/' Swell dissipation ',a/ &
6480  ' --------------------------------------------------')
6481 940 FORMAT ( ' subroutine W3SWL6 activated : ',a/ &
6482  ' coefficient b1 ',a, ' : ',e10.3/ )
6483 2937 FORMAT ( ' &SWL6 SWLB1 = ',e10.3,', CSTB1 = ',l,' /')
6484 #endif
6485  !
6486 #ifdef W3_BT0
6487 926 FORMAT (/' Bottom friction not defined.'/)
6488 #endif
6489  !
6490 #ifdef W3_BT1
6491 926 FORMAT (/' Bottom friction (JONSWAP) ',a/ &
6492  ' --------------------------------------------------')
6493 927 FORMAT ( ' gamma :',f8.4/)
6494 2926 FORMAT ( ' &SBT1 GAMMA =',e12.4,' /')
6495 #endif
6496  !
6497 #ifdef W3_BT4
6498 926 FORMAT (/' Bottom friction (SHOWEX) ',a/ &
6499  ' --------------------------------------------------')
6500 927 FORMAT ( ' SEDMAPD50, SED_D50_UNIFORM :',l3,1x,f8.6/ &
6501  ' RIPFAC1,RIPFAC2,RIPFAC3,RIPFAC4 :',4f8.4/ &
6502  ' SIGDEPTH, BOTROUGHMIN, BOTROUGHFAC:',3f8.4/)
6503 2926 FORMAT ( ' &SBT4 SEDMAPD50 =',l3,', SED_D50_UNIFORM =',f8.6,','/ &
6504  ' RIPFAC1 =',f8.4,', RIPFAC2 =',f8.4, &
6505  ', RIPFAC3 =',f8.4,', RIPFAC4 =',f8.4,','/ &
6506  ' SIGDEPTH =',f8.4,', BOTROUGHMIN =',f8.4, &
6507  ', BOTROUGHFAC =',f4.1,' /')
6508 #endif
6509  !
6510 #ifdef W3_DB0
6511 928 FORMAT (/' Surf breaking not defined.'/)
6512 #endif
6513  !
6514 #ifdef W3_DB1
6515 928 FORMAT (/' Surf breaking (B&J 1978) ',a/ &
6516  ' --------------------------------------------------')
6517 929 FORMAT ( ' alpha :',f8.3/ &
6518  ' gamma :',f8.3)
6519 2928 FORMAT ( ' &SDB1 BJALFA =',f7.3,', BJGAM =',f7.3, &
6520  ', BJFLAG = ',a,' /')
6521 #endif
6522  !
6523 #ifdef W3_TR0
6524 930 FORMAT (/' Triad interactions not defined.'/)
6525 #endif
6526  !
6527 #ifdef W3_BS0
6528 932 FORMAT (/' Bottom scattering not defined.'/)
6529 #endif
6530 #ifdef W3_BS1
6531 932 FORMAT (/' Experimental bottom scattering (F. Ardhuin).'/)
6532 #endif
6533  !
6534 #ifdef W3_IC1
6535 935 FORMAT (/' Dissipation via ice parameters (SIC1).'&
6536  ,/' --------------------------------------------------')
6537 #endif
6538  !
6539 #ifdef W3_IC2
6540 935 FORMAT (/' Dissipation via ice parameters (SIC2).'&
6541  ,/' --------------------------------------------------')
6542 #endif
6543  !
6544 #ifdef W3_IC3
6545 935 FORMAT (/' Dissipation via ice parameters (SIC3).'&
6546  ,/' --------------------------------------------------')
6547 #endif
6548  !
6549 #ifdef W3_IC4
6550 935 FORMAT (/' Dissipation via ice parameters (SIC4).'&
6551  ,/' --------------------------------------------------')
6552 #endif
6553  !
6554 #ifdef W3_IC5
6555 935 FORMAT (/' Dissipation via ice parameters (SIC5).'&
6556  ,/' --------------------------------------------------')
6557 #endif
6558  !
6559 #ifdef W3_IS0
6560 944 FORMAT (/' Ice scattering not defined.'/)
6561 #endif
6562 #ifdef W3_IS1
6563 945 FORMAT (/' Ice scattering ',a,/ &
6564  ' --------------------------------------------------')
6565 946 FORMAT (' Isotropic (linear function of ice concentration)'/&
6566  ' slope : ',e10.3/ &
6567  ' offset : ',e10.3)
6568 2946 FORMAT ( ' &SIS1 ISC1 =',e10.3,', ISC2 =',e10.3)
6569 #endif
6570 #ifdef W3_IS2
6571 947 FORMAT (/' Ice scattering ',a,/ &
6572  ' --------------------------------------------------')
6573 948 FORMAT (' IS2 Scattering ... '/&
6574  ' scattering coefficient : ',e10.3/ &
6575  ' 0: no back-scattering : ',e10.3/ &
6576  ' TRUE: istropic back-scattering : ',l3/ &
6577  ' TRUE: update of ICEDMAX : ',l3/ &
6578  ' TRUE: keeps updated ICEDMAX : ',l3/ &
6579  ' flexural strength : ',e10.3/ &
6580  ' TRUE: uses Robinson-Palmer disp.: ',l3/ &
6581  ' attenuation : ',f5.2/ &
6582  ' fragility : ',f5.2/ &
6583  ' minimum floe size in meters : ',f5.2/ &
6584  ' pack scattering coef 1 : ',f5.2/ &
6585  ' pack scattering coef 2 : ',f5.2/ &
6586  ' scaling by concentration : ',f5.2/ &
6587  ' creep B coefficient : ',e10.3/ &
6588  ' creep C coefficient : ',f5.2/ &
6589  ' creep D coefficient : ',f5.2/ &
6590  ' creep N power : ',f5.2/ &
6591  ' elastic energy factor : ',f5.2/ &
6592  ' factor for ice breakup : ',f5.2/ &
6593  ' IS2WIM1 : ',f5.2/ &
6594  ' anelastic dissipation : ',l3/ &
6595  ' energy of activation : ',f5.2/ &
6596  ' anelastic coefficient : ',e11.3/ &
6597  ' anelastic exponent : ',f5.2)
6598 2948 FORMAT ( ' &SIS2 ISC1 =',e10.3,', IS2BACKSCAT =',e10.3, &
6599  ', IS2ISOSCAT =',l3,', IS2BREAK =',l3, &
6600  ', IS2DUPDATE =',l3,','/ &
6601  ' IS2FLEXSTR =',e11.3,', IS2DISP =',l3, &
6602  ', IS2DAMP =',f3.1, &
6603  ', IS2FRAGILITY =',f4.2,', IS2DMIN =',f5.2,','/ &
6604  ' IS2C2 =',f12.8,', IS2C3 =',f8.4, &
6605  ', IS2CONC =',f5.1,', IS2CREEPB =',e11.3,','/ &
6606  ' IS2CREEPC =',f5.2,', IS2CREEPD =',f5.2, &
6607  ', IS2CREEPN =',f5.2,','/ &
6608  ' IS2BREAKE =',f5.2, &
6609  ', IS2BREAKF =',f5.2,', IS2WIM1 =',f5.2,','/ &
6610  ', IS2ANDISB =',l3,', IS2ANDISE =',f5.2, &
6611  ', IS2ANDISD =',e11.3,', IS2ANDISN=',f5.2, ' /')
6612 #endif
6613 #ifdef W3_UOST
6614 4500 FORMAT (/' Unresolved Obstacles Source Term (UOST) ',a,/ &
6615  ' --------------------------------------------------')
6616 4501 FORMAT (' local alpha-beta file: ',a, &
6617  ' shadow alpha-beta file: ',a,/ &
6618  ' local calibration factor: ',f5.2, &
6619  ' shadow calibration factor: ',f5.2)
6620 4502 FORMAT (' &UOST UOSTFILELOCAL = ',a,', UOSTFILESHADOW = ',a,/ &
6621  ' UOSTFACTORLOCAL = ',f5.2', UOSTFACTORSHADOW = ',f5.2,' /')
6622 #endif
6623  !
6624 950 FORMAT (/' Propagation scheme : '/ &
6625  ' --------------------------------------------------')
6626 951 FORMAT ( ' Type of scheme (structured) :',1x,a)
6627 2951 FORMAT ( ' Type of scheme(unstructured):',1x,a)
6628 2952 FORMAT ( ' wave setup computation:',1x,a)
6629 952 FORMAT ( ' ',1x,a)
6630 #ifdef W3_PR1
6631 953 FORMAT ( ' CFLmax depth refraction :',f9.3/)
6632 2953 FORMAT ( ' &PRO1 CFLTM =',f5.2,' /')
6633 #endif
6634  !
6635 #ifdef W3_PR2
6636 953 FORMAT ( ' CFLmax depth refraction :',f9.3/ &
6637  ' Effective swell age (h) : switched off'/ &
6638  ' Cut-off latitude (degr.) :',f7.1/)
6639 954 FORMAT ( ' CFLmax depth refraction :',f9.3/ &
6640  ' Effective swell age (h) :',f8.2/ &
6641  ' Cut-off latitude (degr.) :',f7.1/)
6642 2953 FORMAT ( ' &PRO2 CFLTM =',f5.2,', DTIME =',f8.0, &
6643  ', LATMIN =',f5.1,' /')
6644 #endif
6645  !
6646 #ifdef W3_SMC
6647 1950 FORMAT (/' SMC grid parameters : '/ &
6648  ' --------------------------------------------------')
6649 1951 FORMAT ( ' Type of scheme (structured) :',1x,a)
6650 1953 FORMAT ( ' Max propagation CFL number :',f9.3/ &
6651  ' Effective swell age (h) :',f8.2/ &
6652  ' Maximum refraction (degr.) :',f8.2/)
6653 2954 FORMAT ( ' &PSMC CFLSM =',f5.2,', DTIMS =', f9.1/ &
6654  ' Arctic =',l5, ', RFMAXD =', f9.2/ &
6655  ' UNO3 =',l5, ', AVERG =',l5/ &
6656  ' LvSMC =',i5, ', NBISMC =',i9/ &
6657  ' ISHFT =',i5, ', JEQT =',i9/ &
6658  ' SEAWND =',l5, '/')
6659 #endif
6660  !
6661 #ifdef W3_PR3
6662 953 FORMAT ( ' CFLmax depth refraction :',f9.3/ &
6663  ' Averaging area factor Cg :',f8.2)
6664 954 FORMAT ( ' Averaging area factor theta :',f8.2)
6665 955 FORMAT ( .GE.' **** Internal maximum ',f6.2,' ****')
6666 2953 FORMAT ( ' &PRO3 CFLTM =',f5.2, &
6667  ', WDTHCG = ',f4.2,', WDTHTH = ',f4.2,' /')
6668 #endif
6669  !
6670 2956 FORMAT ( ' &UNST UGBCCFL =',l3,', UGOBCAUTO =',l3, &
6671  ', UGOBCDEPTH =', f8.3,', UGOBCFILE=',a,','/ &
6672  ', EXPFSN =',l3,',EXPFSPSI =',l3, &
6673  ', EXPFSFCT =', l3,',IMPFSN =',l3,',EXPTOTAL=',l3, &
6674  ', IMPTOTAL=',l3,',IMPREFRACTION=', l3, &
6675  ', IMPFREQSHIFT=', l3,', IMPSOURCE=', l3, &
6676  ', SETUP_APPLY_WLV=', l3, &
6677  ', JGS_TERMINATE_MAXITER=', l3, &
6678  ', JGS_TERMINATE_DIFFERENCE=', l3, &
6679  ', JGS_TERMINATE_NORM=', l3, &
6680  ', JGS_LIMITER=', l3, &
6681  ', JGS_LIMITER_FUNC=', i3, &
6682  ', JGS_USE_JACOBI=', l3, &
6683  ', JGS_BLOCK_GAUSS_SEIDEL=', l3, &
6684  ', JGS_MAXITER=', i5, &
6685  ', JGS_PMIN=', f8.3, &
6686  ', JGS_DIFF_THR=', f8.3, &
6687  ', JGS_NORM_THR=', f8.3, &
6688  ', JGS_NLEVEL=', i3, &
6689  ', JGS_SOURCE_NONLINEAR=', l3 / )
6690  !
6691 960 FORMAT (/' Miscellaneous ',a/ &
6692  ' --------------------------------------------------')
6693 2961 FORMAT ( ' *** WAVEWATCH-III WARNING IN W3GRID :'/ &
6694  .NE.' CICE0CICEN requires FLAGTR>2'/ &
6695  ' Parameters corrected: CICE0 = CICEN'/)
6696 2962 FORMAT (/' *** WAVEWATCH-III WARNING IN W3GRID : User requests', &
6697  'CICE0=CICEN corresponding to discontinuous treatment of ', &
6698  'ice, so we will change FLAGTR')
6699 2963 FORMAT (/' *** WAVEWATCH-III WARNING IN W3GRID :'/ &
6700  ' Ice physics used, so we will change FLAGTR.')
6701 961 FORMAT ( ' Ice concentration cut-offs :',f8.2,f6.2)
6702 #ifdef W3_MGG
6703 962 FORMAT ( ' Moving grid GSE cor. power :',f8.2)
6704 #endif
6705 #ifdef W3_SCRIP
6706 963 FORMAT( ' Grid offset for multi-grid w/SCRIP : ',e11.3)
6707 #endif
6708 1972 FORMAT ( ' Compression of track output : ',l3)
6709 #ifdef W3_SEED
6710 964 FORMAT ( ' Xseed in seeding algorithm :',f8.2)
6711 #endif
6712 965 FORMAT (/' Dynamic source term integration scheme :'/ &
6713  ' Xp (-) :',f9.3/ &
6714  ' Xr (-) :',f9.3/ &
6715  ' Xfilt (-) :',f9.3)
6716 966 FORMAT (/' Wave field partitioning :'/ &
6717  ' Levels (-) :',i5/ &
6718  ' Minimum wave height (m) :',f9.3/ &
6719  ' Wind area multiplier (-) :',f9.3/ &
6720  ' Cut-off wind sea fract. (-) :',f9.3/ &
6721  ' Combine wind seas : ',a/ &
6722  ' Number of swells in fld out :',i5)
6723 967 FORMAT (/' Miche-style limiting wave height :'/ &
6724  ' Hs,max/d factor (-) :',f9.3/ &
6725  ' Hrms,max/d factor (-) :',f9.3/ &
6726  ' Limiter activated : ',a)
6727 968 FORMAT ( ' *** FACTOR DANGEROUSLY LOW ***')
6728 1973 FORMAT (/' Calendar type : ',a)
6729  !
6730 #ifdef W3_REF1
6731 969 FORMAT (/' Shoreline reflection ',a/ &
6732  ' --------------------------------------------------')
6733 #endif
6734  !
6735 #ifdef W3_IG1
6736 970 FORMAT (/' Second order and infragravity waves ',a/ &
6737  ' --------------------------------------------------')
6738 #endif
6739  !
6740 5971 FORMAT (' Partitioning method : ',a)
6741 5972 FORMAT (' Namelist options overridden : ',a)
6742  !
6743 #ifdef W3_IC2
6744 971 FORMAT (/' Boundary layer below ice ',a/ &
6745  ' --------------------------------------------------')
6746 #endif
6747 #ifdef W3_IC3
6748 971 FORMAT (/' Visco-elastic ice layer ',a/ &
6749  ' --------------------------------------------------')
6750 #endif
6751 #ifdef W3_IC4
6752 971 FORMAT (/' Empirical wave-ice physics ',a/ &
6753  ' --------------------------------------------------')
6754 #endif
6755 #ifdef W3_IC5
6756 971 FORMAT (/' Effective medium ice model (SIC5) ',a/ &
6757  ' --------------------------------------------------')
6758 2971 FORMAT ( ' Min. Ice shear modulus G : ', e10.1/, &
6759  ' Min. Wave period T : ', f7.2/, &
6760  ' Max. Wavenumber Ratio (Ko/Kr): ', e10.1/, &
6761  ' Max. Attenu. Rate (Ki) : ', e10.1/, &
6762  ' Min. Water depth (d) : ', f5.0/, &
6763  ' Max. # of Newton Iter. : ', f5.0/, &
6764  ' Use Rand. Kick : ', f5.0/, &
6765  ' Excluded Imag. Corridor : ', f9.4/, &
6766  ' Selected ice model : ', a/)
6767 #endif
6768  !
6769 8972 FORMAT ( ' Wind input reduction factor in presence of ', &
6770  /' ice :',f6.2, &
6771  /' (0.0==> no reduction and 1.0==> no wind', &
6772  /' input with 100% ice cover)')
6773  !
6774  !
6775 4970 FORMAT (/' Spectral output on full grid ',a/ &
6776  ' --------------------------------------------------')
6777 4971 FORMAT ( ' Second order pressure at K=0:',3i4)
6778 4972 FORMAT ( ' Spectrum of Uss :',3i4)
6779 4973 FORMAT ( ' Frequency spectrum :',3i4)
6780 4974 FORMAT ( ' Partions of Uss :',2i4)
6781 4975 FORMAT ( ' Partition wavenumber #',i2,' : ',1f6.3)
6782 
6783  !
6784 4980 FORMAT (/' Coastal / iceberg reflection ',a/ &
6785  ' --------------------------------------------------')
6786 4981 FORMAT ( ' Coefficient for shorelines :',f6.4)
6787 4989 FORMAT ( ' *** CURVLINEAR GRID: REFLECTION NOT IMPLEMENTED YET ***')
6788 2977 FORMAT ( ' &SIG1 IGMETHOD =',i2,', IGADDOUTP =',i2,', IGSOURCE =',i2, &
6789  ', IGSTERMS = ',i2,', IGBCOVERWRITE =', l3,','/ &
6790  ' IGSWELLMAX =', l3,', IGMAXFREQ =',f6.4, &
6791  ', IGSOURCEATBP = ',i2,', IGKDMIN = ',f6.4,','/ &
6792  ' IGFIXEDDEPTH = ',f6.2,', IGEMPIRICAL = ',f8.6,' /')
6793  !
6794 2978 FORMAT ( ' &SIC2 IC2DISPER =',l3,', IC2TURB =',f6.2, &
6795  ', IC2ROUGH =',f10.6,','/ &
6796  ' IC2REYNOLDS = ',f10.1,', IC2SMOOTH = ',f10.1, &
6797  ', IC2VISC =',f6.3,','/ &
6798  ', IC2TURBS =',f8.2,', IC2DMAX =',f5.3,' /')
6799  !
6800 2979 FORMAT ( ' &SIC3 IC3MAXTHK =',f6.2, ', IC3MAXCNC =',f6.2,','/ &
6801  ' IC2TURB =',f8.2, &
6802  ', IC2ROUGH =',f7.3,','/ &
6803  ' IC2REYNOLDS = ',f10.1,', IC2SMOOTH = ',f10.1, &
6804  ', IC2VISC =',f10.3,','/ &
6805  ' IC2TURBS =',f8.2,', IC3CHENG =',l3, &
6806  ', USECGICE =',l3,', IC3HILIM = ',f6.2,','/ &
6807  ' IC3KILIM = ',e9.2,', IC3HICE = ',e9.2, &
6808  ', IC3VISC = ',e9.2,','/ &
6809  ' IC3DENS = ',e9.2,', IC3ELAS = ',e9.2,' /')
6810  !
6811 2981 FORMAT ( ' &SIC5 IC5MINIG = ', e9.2, ', IC5MINWT = ', f5.2, &
6812  ', IC5MAXKRATIO = ', e9.2, ','/ &
6813  ' IC5MAXKI = ', e9.2, ', IC5MINHW = ', f4.0, &
6814  ', IC5MAXITER = ', f4.0, ','/ &
6815  ' IC5RKICK = ', f2.0, ', IC5KFILTER = ', f7.4, &
6816  ', IC5VEMOD = ', f4.0, ' /')
6817  !
6818 2966 FORMAT ( ' &MISC CICE0 =',f6.3,', CICEN =',f6.3, &
6819  ', LICE = ',f8.1,', PMOVE =',f6.3,','/ &
6820  ' XSEED =',f6.3,', FLAGTR = ', i1, &
6821  ', XP =',f6.3,', XR =',f6.3,', XFILT =', f6.3 / &
6822  ' IHM =',i5,', HSPM =',f6.3,', WSM =',f6.3, &
6823  ', WSC =',f6.3,', FLC = ',a/ &
6824  ' NOSW =',i3,', FMICHE =',f6.3,', RWNDC =' , &
6825  f6.3,', WCOR1 =',f6.2,', WCOR2 =',f6.2,','/ &
6826  ' FACBERG =',f4.1,', GSHIFT = ',e11.3, &
6827  ', STDX = ' ,f7.2,', STDY =',f7.2,','/ &
6828  ' STDT =', f8.2, &
6829  ', ICEHMIN =',f5.2,', ICEHFAC =',f5.2,','/ &
6830  ' ICEHINIT =',f5.2,', ICEDISP =',l3, &
6831  ', ICEHDISP =',f5.2,','/ &
6832  ' ICESLN = ',f6.2,', ICEWIND = ',f6.2, &
6833  ', ICESNL = ',f6.2,', ICESDS = ',f5.2,','/ &
6834  ' ICEDDISP = ',f5.2,', ICEFDISP = ',f5.2, &
6835  ', CALTYPE = ',a8,' , TRCKCMPR = ', l3,','/ &
6836  ' BTBET = ', f6.2, ' /')
6837  !
6838 2976 FORMAT ( ' &OUTS P2SF =',i2,', I1P2SF =',i2,', I2P2SF =',i3,','/&
6839  ' US3D =',i2,', I1US3D =',i3,', I2US3D =',i3,','/&
6840  ' USSP =',i2,', IUSSP =',i3,','/&
6841  ' E3D =',i2,', I1E3D =',i3,', I2E3D =',i3,','/&
6842  ' TH1MF =',i2,', I1TH1M =',i3,', I2TH1M =',i3,','/&
6843  ' STH1MF=',i2,', I1STH1M=',i3,', I2STH1M=',i3,','/&
6844  ' TH2MF =',i2,', I1TH2M =',i3,', I2TH2M =',i3,','/&
6845  ' STH2MF=',i2,', I1STH2M=',i3,', I2STH2M=',i3,' /')
6846  !
6847 2986 FORMAT ( ' &REF1 REFCOAST =',f5.2,', REFFREQ =',f5.2,', REFSLOPE =',f5.3, &
6848  ', REFMAP =',f4.1, ', REFMAPD =',f4.1, ', REFSUBGRID =',f5.2,','/ &
6849  ' REFRMAX=',f5.2,', REFFREQPOW =',f5.2, &
6850  ', REFICEBERG =',f5.2,', REFCOSP_STRAIGHT =',f4.1,' /')
6851  !
6852 2987 FORMAT ( ' &FLD TAIL_ID =',i1,' TAIL_LEV =',f5.4,' TAILT1 =',f5.3,&
6853  ' TAILT2 =',f5.3,' /')
6854 #ifdef W3_RTD
6855 
6856 4991 FORMAT ( ' &ROTD PLAT =', f6.2,', PLON =', f7.2,', UNROT =',l3,' /')
6857 4992 FORMAT ( ' &ROTB BPLAT =',9(f6.1,",")/ &
6858  ' BPLON =',9(f6.1,","),' /')
6859 #endif
6860 
6861 3000 FORMAT (/' The spatial grid: '/ &
6862  ' --------------------------------------------------'/ &
6863  /' Grid type : ',a)
6864 3001 FORMAT ( ' Coordinate system : ',a)
6865 3002 FORMAT ( ' Index closure type : ',a)
6866 3003 FORMAT ( ' Dimensions : ',i6,i8)
6867 3004 FORMAT (/' Increments (deg.) :',2f10.4/ &
6868  ' Longitude range (deg.) :',2f10.4/ &
6869  ' Latitude range (deg.) :',2f10.4)
6870 3005 FORMAT ( ' Increments (km) :',2f8.2/ &
6871  ' X range (km) :',2f8.2/ &
6872  ' Y range (km) :',2f8.2)
6873 3006 FORMAT (/' X-coordinate unit :',i6/ &
6874  ' Scale factor :',f10.4/ &
6875  ' Add offset :',e12.4/ &
6876  ' Layout indicator :',i6/ &
6877  ' Format indicator :',i6)
6878 3007 FORMAT (/' Y-coordinate unit :',i6/ &
6879  ' Scale factor :',f10.4/ &
6880  ' Add offset :',e12.4/ &
6881  ' Layout indicator :',i6/ &
6882  ' Format indicator :',i6)
6883 3008 FORMAT ( ' Format : ',a)
6884 3009 FORMAT ( ' File name : ',a)
6885 #ifdef W3_SMC
6886 4001 FORMAT ( ' SMC refined levels NRLv = ',i8)
6887 4002 FORMAT ( ' SMC Equator j shift no. = ',i8)
6888 4302 FORMAT ( ' SMC I-index shift number = ',i8)
6889 4003 FORMAT ( ' SMC input boundary no. = ',i8)
6890 4004 FORMAT ( ' SMC NCel = ',6i9)
6891 4005 FORMAT ( ' IJKCel(5,NCel) read from ', a)
6892 4006 FORMAT (6i8)
6893 4007 FORMAT ( ' SMC NUFc = ',6i9)
6894 4008 FORMAT ( ' IJKUFc(7,NCel) read from ', a)
6895 4009 FORMAT (8i8)
6896 4010 FORMAT ( ' SMC NVFc = ',6i9)
6897 4011 FORMAT ( ' IJKVFc(8,NCel) read from ', a)
6898 4110 FORMAT ( ' SMC NCObsr = ',6i9)
6899 4111 FORMAT ( ' IJKObstr(1,NCel) read from ', a)
6900 4012 FORMAT (9i8)
6901 4013 FORMAT ( ' NBICelin(NBISMC) read from ', a)
6902 4014 FORMAT (2i8)
6903 4015 FORMAT ( ' ARC NARC = ',6i9)
6904 4016 FORMAT ( ' IJKCel(5,NARC) read from ', a)
6905 4017 FORMAT ( ' ARC NAUI = ',6i9)
6906 4018 FORMAT ( ' IJKUFc(7,NAUI) read from ', a)
6907 4019 FORMAT ( ' ARC NAVJ = ',6i9)
6908 4020 FORMAT ( ' IJKVFc(8,NAVJ) read from ', a)
6909 4021 FORMAT ( ' Varables by W3DIMX NCel = ',i9)
6910 4022 FORMAT ( ' Defined NLvCel ',6i9)
6911 4023 FORMAT ( ' Defined NLvUFc ',6i9)
6912 4024 FORMAT ( ' Defined NLvVFc ',6i9)
6913 4025 FORMAT ( ' Define IJKCel from -9 to ',i9)
6914 4026 FORMAT ( ' IJKCel(5,NCel) defined : ')
6915 4027 FORMAT ( ' IJKUFc(7,NUFc) defined : ')
6916 4028 FORMAT ( ' IJKVFc(8,NVFc) defined : ')
6917 4029 FORMAT ( ' Boundary cells IJKCel(:,-9:0) : ')
6918 4030 FORMAT (5i8)
6919 4031 FORMAT ( ' Define MAPSF ... 1 to ',i9)
6920 4032 FORMAT ( ' Multi-Resolution factor = ',i6)
6921 4033 FORMAT ( ' Range of MAPSF(:,1) : ',2i9)
6922 4034 FORMAT ( ' Range of MAPSF(:,2) : ',2i9)
6923 4035 FORMAT ( ' Range of MAPSF(:,3) : ',2i9)
6924 4036 FORMAT ( ' Range of MAPFS(:,:) : ',2i9)
6925 4037 FORMAT ( ' Arctic AngArc defined as ',i6)
6926 4038 FORMAT (9f8.2)
6927 4039 FORMAT ( ' Arctic ICLBAC defined as ',i6)
6928 4040 FORMAT (9i8)
6929 #endif
6930 #ifdef W3_RTD
6931 4200 FORMAT ( ' AnglDin(NX,NY) defn checks : ')
6932 4201 FORMAT ( ' JY/IX',4i8)
6933 4202 FORMAT (i12,4f8.2)
6934 4203 FORMAT ( ' Rotated pole lat/lon (deg.) : ',2f9.3)
6935 4204 FORMAT ( ' Output dirns and x-y vectors will be set to True North')
6936 #endif
6937 972 FORMAT (/' Bottom level unit :',i6/ &
6938  ' Limiting depth (m) :',f8.2/ &
6939  ' Minimum depth (m) :',f8.2/ &
6940  ' Scale factor :',f8.2/ &
6941  ' Layout indicator :',i6/ &
6942  ' Format indicator :',i6)
6943 973 FORMAT ( ' Format : ',a)
6944 974 FORMAT ( ' File name : ',a)
6945 976 FORMAT (/' Sub-grid information : ',a)
6946 977 FORMAT ( ' Obstructions unit :',i6/ &
6947  ' Scale factor :',f10.4/ &
6948  ' Layout indicator :',i6/ &
6949  ' Format indicator :',i6)
6950 978 FORMAT (/' Mask information : From file.'/ &
6951  ' Mask unit :',i6/ &
6952  ' Layout indicator :',i6/ &
6953  ' Format indicator :',i6)
6954 1977 FORMAT ( ' Shoreline slope :',i6/ &
6955  ' Scale factor :',f10.4/ &
6956  ' Layout indicator :',i6/ &
6957  ' Format indicator :',i6)
6958 1978 FORMAT ( ' Grain sizes :',i6/ &
6959  ' Scale factor :',f10.4/ &
6960  ' Layout indicator :',i6/ &
6961  ' Format indicator :',i6)
6962  !
6963 979 FORMAT ( ' Processing ',a)
6964 980 FORMAT (/' Input boundary points : '/ &
6965  ' --------------------------------------------------')
6966 1980 FORMAT (/' Excluded points : '/ &
6967  ' --------------------------------------------------')
6968 981 FORMAT ( ' *** POINT OUTSIDE GRID (SKIPPED), IX, IY =')
6969 1981 FORMAT ( ' *** POINT ALREADY EXCLUDED (SKIPPED), IX, IY =')
6970 982 FORMAT ( ' *** CANNOT CONNECT POINTS, IX, IY =')
6971 985 FORMAT ( ' No boundary points.'/)
6972 986 FORMAT ( ' Number of boundary points :',i6/)
6973 1985 FORMAT ( ' No excluded points.'/)
6974 1986 FORMAT ( ' Number of excluded points :',i6/)
6975 987 FORMAT ( ' Nr.| IX | IY | Long. | Lat. '/ &
6976  ' -----|-------|-------|---------|---------')
6977 1987 FORMAT ( ' Nr.| IX | IY | X | Y '/ &
6978  ' -----|-------|-------|-----------|-----------')
6979 988 FORMAT ( ' ',i4,2(' |',i6),2(' |',f8.2))
6980 1988 FORMAT ( ' ',i4,2(' |',i6),2(' |',f8.1,'E3'))
6981 989 FORMAT ( ' ')
6982  !
6983 990 FORMAT (/' Output boundary points : '/ &
6984  ' --------------------------------------------------')
6985 991 FORMAT ( ' File nest',i1,'.ww3 Number of points :',i6/ &
6986  ' Number of spectra :',i6)
6987 1991 FORMAT ( ' Dest. grid Polat:',f6.2,', Polon:',f8.2)
6988 992 FORMAT (/' Nr.| Long. | Lat. '/ &
6989  ' -----|---------|---------')
6990 1992 FORMAT (/' Nr.| Long. | Lat. ', &
6991  ' Nr.| Long. | Lat. '/ &
6992  ' -----|---------|---------', &
6993  ' -----|---------|---------')
6994 993 FORMAT ( ' ',i4,2(' |',f8.2))
6995 1993 FORMAT ( ' ',i4,2(' |',f8.2), &
6996  ' ',i4,2(' |',f8.2))
6997 994 FORMAT ( ' *** POINT OUTSIDE GRID (SKIPPED) : X,Y =',2f10.5)
6998 995 FORMAT ( ' *** POINT ON LAND (SKIPPED) : X,Y =',2f10.5)
6999 2992 FORMAT (/' Nr.| X | Y '/ &
7000  ' -----|-----------|-----------')
7001 3992 FORMAT (/' Nr.| X | Y ', &
7002  ' Nr.| X | Y '/ &
7003  ' -----|-----------|-----------', &
7004  ' -----|-----------|-----------')
7005 2993 FORMAT ( ' ',i4,2(' |',f8.1,'E3'))
7006 3993 FORMAT ( ' ',i4,2(' |',f8.1,'E3'), &
7007  ' ',i4,2(' |',f8.1,'E3'))
7008 2994 FORMAT ( ' *** POINT OUTSIDE GRID (SKIPPED) : X,Y =',2(f8.1,'E3'))
7009 2995 FORMAT ( ' *** POINT ON LAND (SKIPPED) : X,Y =',2(f8.1,'E3'))
7010 996 FORMAT ( ' No boundary points.'/)
7011 997 FORMAT ( ' Number of boundary points :',i6/ &
7012  ' Number of spectra :',i6/)
7013  !
7014 #ifdef W3_O2a
7015 998 FORMAT (50i2)
7016 #endif
7017 #ifdef W3_O2c
7018 1998 FORMAT (50i2)
7019 #endif
7020  !
7021 999 FORMAT (/' Writing model definition file ...'/)
7022  !
7023 1000 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7024  ' ERROR IN OPENING INPUT FILE'/ &
7025  ' IOSTAT =',i5/)
7026  !
7027 1001 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7028  ' PREMATURE END OF INPUT FILE'/)
7029  !
7030 1002 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7031  ' ERROR IN READING FROM INPUT FILE'/ &
7032  ' IOSTAT =',i5/)
7033  !
7034 1003 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7035  ' INVALID CALENDAR TYPE: SELECT ONE OF:', &
7036  ' standard, 360_day, or 365_day '/)
7037  !
7038 1004 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7039  ' CANNOT READ UNFORMATTED (IDFM = 3) FROM UNIT', &
7040  i4,' (ww3_grid.inp)'/)
7041  !
7042 1005 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID : '/ &
7043  ' BOTTOM AND OBSTRUCTION DATA FROM SAME FILE '/ &
7044  ' BUT WITH INCOMPATIBLE FORMATS (',i1,',',i1,')'/)
7045  !
7046 1006 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7047  ' TOO MANY NESTING OUTPUT FILES '/)
7048  !
7049 1007 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7050  ' ILLEGAL GRID TYPE:',a4)
7051  !
7052 1008 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7053  ' A CARTESIAN WITH CLOSURE IS NOT ALLOWED')
7054  !
7055 1009 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7056  ' A RECTILINEAR TRIPOLE GRID IS NOT ALLOWED')
7057  !
7058 1010 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'// &
7059  ' NO PROPAGATION + NO SOURCE TERMS = NO WAVE MODEL'// &
7060  ' ( USE DRY RUN FLAG TO TEMPORARILY SWITCH OFF ', &
7061  'CALCULATIONS )'/)
7062  !
7063 1011 FORMAT (/' *** WAVEWATCH-III WARNING IN W3GRID :'/ &
7064  ' LEFT-HANDED GRID -- POSSIBLE CAUSE IS WRONG '/ &
7065  ' IDLA:',i4,' . THIS MAY PRODUCE ERRORS '/ &
7066  ' (COMMENT THIS EXTCDE AT YOUR OWN RISK).')
7067  !
7068 1012 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7069  ' ILLEGAL GRID CLOSURE TYPE:',a4)
7070  !
7071 1013 FORMAT (/' *** WAVEWATCH-III WARNING IN W3GRID :'/ &
7072  ' THE GLOBAL (LOGICAL) INPUT FLAG IS DEPRECATED'/ &
7073  ' AND REPLACED WITH A STRING INDICATING THE TYPE'/ &
7074  ' OF GRID INDEX CLOSURE (NONE, SMPL or TRPL).'/ &
7075  ' *** PLEASE UPDATE YOUR GRID INPUT FILE ACCORDINGLY ***'/)
7076  !
7077 #ifdef W3_SMC
7078 1014 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7079  ' SMC CELL LONGITUDE RANGE OUTSIDE BASE GRID RANGE:'/&
7080  ' ISEA =', i6, '; IX =', i4, ':', i4,'; NX =', i4/)
7081 1015 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7082  ' SMC CELL LATITUDE RANGE OUTSIDE BASE GRID RANGE: '/&
7083  ' ISEA =', i6, '; IY =', i4, ':', i4,'; NY =', i4/)
7084 #endif
7085  !
7086 1020 FORMAT (/' *** WAVEWATCH-III ERROR IN W3GRID :'/ &
7087  ' SOURCE TERMS REQUESTED BUT NOT SELECTED'/)
7088 1021 FORMAT (/' *** WAVEWATCH III WARNING IN W3GRID :'/ &
7089  ' SOURCE TERMS SELECTED BUT NOT REQUESTED'/)
7090 1022 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7091  ' ILLEGAL NUMBER OF !/LNn OR SEED SWITCHES :',i3)
7092 1023 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7093  ' ILLEGAL NUMBER OF !/STn SWITCHES :',i3)
7094 1024 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7095  ' ILLEGAL NUMBER OF !/NLn SWITCHES :',i3)
7096 1025 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7097  ' ILLEGAL NUMBER OF !/BTn SWITCHES :',i3)
7098 1026 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7099  ' ILLEGAL NUMBER OF !/DBn SWITCHES :',i3)
7100 1027 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7101  ' ILLEGAL NUMBER OF !/TRn SWITCHES :',i3)
7102 1028 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7103  ' ILLEGAL NUMBER OF !/BSn SWITCHES :',i3)
7104  !
7105 1030 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7106  ' PROPAGATION REQUESTED BUT NO SCHEME SELECTED '/)
7107 1031 FORMAT (/' *** WAVEWATCH III WARNING IN W3GRID :'/ &
7108  ' NO PROPAGATION REQUESTED BUT SCHEME SELECTED '/)
7109 1032 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7110  ' NO PROPAGATION SCHEME SELECTED ( use !/PR0 ) '/)
7111 1033 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7112  ' MULTIPLE PROPAGATION SCHEMES SELECTED :',i3/ &
7113  ' CHECK !/PRn SWITCHES'/)
7114 1034 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7115  ' ILLEGAL NUMBER OF !/ICn SWITCHES :',i3)
7116 1035 FORMAT (/' *** WAVEWATCH III WARNING IN W3GRID :'/ &
7117  ' ONLY FIRST PROPAGATION SCHEME WILL BE USED: ')
7118 1036 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7119  ' ILLEGAL NUMBER OF !/ISn SWITCHES :',i3)
7120 #ifdef W3_RTD
7121 1052 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7122  ' WITH NAMELIST VALUE PLAT == 90, PLON MUST BE -180'/ &
7123  ' AND UNROT MUST BE .FALSE.' )
7124 1053 FORMAT (/' *** WAVEWATCH III ERROR IN W3GRID :'/ &
7125  ' WITH NAMELIST VALUE BPLAT == 90, BPLON MUST BE -180')
7126 #endif
7127  !
7128 1040 FORMAT ( ' Space-time extremes DX :',f10.2)
7129 1041 FORMAT ( ' Space-time extremes DX :',f10.2)
7130 1042 FORMAT ( ' Space-time extremes DX-Y set to default 1000 m')
7131 1043 FORMAT ( ' Space-time extremes Dt :',f8.2)
7132 1044 FORMAT ( ' Space-time extremes Dt set to default 1200 s')
7133  !
7134 1100 FORMAT (/' Status map, printed in',i6,' part(s) '/ &
7135  ' -----------------------------------'/)
7136 1101 FORMAT (2x,180i2)
7137 1102 FORMAT ( ' Legend : '/ &
7138  ' -----------------------------'/ &
7139  ' 0 : Land point '/ &
7140  ' 1 : Sea point '/ &
7141  ' 2 : Active boundary point '/ &
7142  ' 3 : Excluded point '/)
7143 1103 FORMAT (/' Obstruction map ',a1,', printed in',i6,' part(s) '/ &
7144  ' ---------------------------------------------'/)
7145 1104 FORMAT ( ' Legend : '/ &
7146  ' --------------------------------'/ &
7147  ' fraction of obstruction * 10 '/)
7148 
7149 1105 FORMAT (/' Shoreline slope, printed in',i6,' part(s) '/ &
7150  ' ---------------------------------------------'/)
7151 1106 FORMAT ( ' Legend : '/ &
7152  ' --------------------------------'/ &
7153  ' Slope * 100'/)
7154 
7155 
7156 1150 FORMAT (/' Reading unstructured grid definition files ...'/)
7157  !
7158 9997 FORMAT (/' Summary grid statistics : '/ &
7159  ' --------------------------------------------------'/ &
7160  ' Number of longitudes :',i10/ &
7161  ' Number of latitudes :',i10/ &
7162  ' Number of grid points :',i10/ &
7163  ' Number of sea points :',i10,' (',f4.1,'%)'/&
7164  ' Number of input b. points :',i10/ &
7165  ' Number of land points :',i10/ &
7166  ' Number of excluded points :',i10/)
7167 9998 FORMAT (/' Summary grid statistics : '/ &
7168  ' --------------------------------------------------'/ &
7169  ' Number of longitudes :',i10/ &
7170  ' Number of latitudes :',i10/ &
7171  ' Number of grid points :',i10/ &
7172  ' Number of sea points :',i10,' (100%)'/ &
7173  ' Number of input b. points :',i10/ &
7174  ' Number of land points :',i10/ &
7175  ' Number of excluded points :',i10/)
7176 9999 FORMAT (/' End of program '/ &
7177  ' ========================================'/ &
7178  ' WAVEWATCH III Grid preprocessor '/)
7179  !
7180 #ifdef W3_T
7181 9090 FORMAT ( ' TEST W3GRID : OUTPUT BOUND. POINT DATA LINE SEG.')
7182 9091 FORMAT ( ' ',2f8.2,4(2i4,f7.2))
7183 9092 FORMAT ( ' ',f7.2,2x,4f7.2)
7184 9093 FORMAT ( ' ',4i7/ &
7185  ' ',4i7)
7186 #endif
7187  !
7188 #ifdef W3_T0
7189 9095 FORMAT ( ' TEST W3GRID : OUTPUT BOUND. POINT SPEC DATA ')
7190 9096 FORMAT ( ' ',i3,2i8)
7191 #endif
7192 

References a34, aircmin, airgb, alpha0, altlp, anglbdy, angldin, apm, arctic, averg, bdylat, bdylon, betamax, bjalfa, bjflag, bjgam, botroughfac, botroughmin, bplat, bplon, bpolat, bpolon, btbet, capcha, cdfac, cdis, cdmax, cflsm, cfltm, cha0, chamin, cice0, cicen, cinp, clin, cneg, comstr, connct, cpos, crit_dep_setup, cstb1, cstrg, ctype, cumsigp, w3dispmd::distab(), dnm, dphid, dptfac, dtime, dtims, dvsmc, dxo, dyo, e3d, elatac, elatbdy, elonac, elonbdy, expfsfct, expfsn, expfspsi, exptotal, facberg, fachf, factor, fc1, fc2, fc3, fhfc, file(), first, flagtr, flbs, flbt, flc, fldb, flgnml, flic, flinds, flis, fllin, flnew, flnl, flnmlo, flprop, flref, flst4, flst6, flstb2, fltc96, fltr, fmiche, fname, fneg, w3odatmd::fnmpre, fpia, fpib, fpos, from, fxfm3, fxfmage, fxpm3, gamma, w3gdatmd::gname, gqamp1, gqamp2, gqamp3, gqamp4, gqmnf1, gqmnq_om2, gqmnt1, gqmthrcou, gqmthrsat, grid_center_lat_varid, grid_center_lon_varid, grid_corner_lat_varid, grid_corner_lon_varid, grid_corners_dimid, grid_dims_varid, grid_imask_varid, grid_rank_dimid, grid_size_dimid, gshift, gstrg, hspm, i, i1e3d, i1p2sf, i1sth1m, i1sth2m, i1th1m, i1th2m, i1us3d, i2e3d, i2p2sf, i2sth1m, i2sth2m, i2th1m, i2th2m, i2us3d, iba, ibi, ic2disper, ic2dmax, ic2reynolds, ic2rough, ic2smooth, ic2turb, ic2turbs, ic2visc, ic3cheng, ic3dens, ic3elas, ic3hice, ic3hilim, ic3kilim, ic3maxcnc, ic3maxthk, ic3visc, ic4cn, ic4fc, ic4fmin, ic4ki, ic4kibk, ic4method, ic5kfilter, ic5maxiter, ic5maxki, ic5maxkratio, ic5minhw, ic5minig, ic5minwt, ic5mstr, ic5rkick, ic5vemod, iceddisp, icedisp, icefdisp, icehdisp, icehfac, icehinit, icehmin, icesds, icesln, icesnl, icewind, idepth, idfm, idft, idla, idx, idy, ient, ierr, ifile, ifl, igaddoutp, igbcoverwrite, igempirical, igfixeddepth, igkdmin, igmaxdep, igmaxfreq, igmethod, igmindep, igsource, igsourceatbp, igsterms, igswellmax, ihm, ijkcelac, ijkcelin, ijkdep, ijkobstr, ijkufcac, ijkufcin, ijkvfc8, ijkvfcac, ijkvfcin, ik, iloop, imap, imapb, impfreqshift, impfsn, imprefraction, impsource, imptotal, indtsa, ingrid, ip, ip0, iph, ipi, ipn, iqtype, is2andisb, is2andisd, is2andise, is2andisn, is2backscat, is2break, is2breake, is2breakf, is2c2, is2c3, is2conc, is2creepb, is2creepc, is2creepd, is2creepn, is2damp, is2disp, is2dmin, is2dupdate, is2flexstr, is2fragility, is2isoscat, is2wim1, isc1, isc2, isea, iseai, ishft, isp, ist, ith, ith0, iussp, ix, ix0, ix1, ix3, ixn, ixo, ixr, iy, iy1, iy3, iyn, iyo, iyr, j, jeqt, jgs_block_gauss_seidel, jgs_diff_thr, jgs_limiter, jgs_limiter_func, jgs_maxiter, jgs_nlevel, jgs_norm_thr, jgs_pmin, jgs_source_nonlinear, jgs_terminate_difference, jgs_terminate_maxiter, jgs_terminate_norm, jgs_use_jacobi, jj, jobs, js, kdconv, kdfd, kdfs, kdmin, lambda, latmin, lice, line, lvsmc, mapout, msc, naui, navj, nba, nbicelin, nbismc, nbotot, nbsel, nbt, ncid, ncobst, ncol, ndepth, ndsg, ndsi, ndsi2, ndsm, ndsma, ndss, ndstr, ndstrc, nfl, ngui, ngvj, nki, nl5dis, nl5dpt, nl5ipl, nl5kev, nl5oml, nl5pmx, nland, nlprop, nlvcelsk, nlvufcsk, nlvvfcsk, nmap, nmapb, nml_curv, nml_depth, nml_excl_body, nml_excl_count, nml_excl_point, nml_grid, nml_inbnd_count, nml_inbnd_point, nml_mask, nml_obst, nml_outbnd_count, nml_outbnd_line, nml_rect, nml_run, nml_sed, nml_slope, nml_smc, nml_spectrum, nml_timesteps, nml_unst, nosw, npo, nqdef, nrbs, nrbt, nrdb, nric, nris, nrlin, nrnl, nrprop, nrsrce, nrtr, nsc, nstat, nthi, ntrace, obsx, obsy, p2sf, phimin, plat, plon, pmnam2, pmname, pmove, pname, pname2, pnsmc, polatac, polonac, ptfc, ptm, qparms, rd, rdtot, readmp, readnl(), refcoast, refcosp_straight, refd, refd2, reffreq, reffreqpow, reficeberg, refmap, refmapd, refrmax, refs, refslope, refsubgrid, refunstsource, rfhf, rfmaxd, rform, rfpm, rfr1, ripfac1, ripfac2, ripfac3, ripfac4, rth0, rwndc, rxfr, sdkof, sdsa0, sdsa1, sdsa2, sdsabk, sdsb0, sdsb1, sdsb2, sdsb3, sdsbchoice, sdsbck, sdsbint, sdsbm0, sdsbm1, sdsbm2, sdsbm3, sdsbm4, sdsbr, sdsbrf1, sdsbrfdf, sdsbt, sdsc1, sdsc2, sdsc4, sdsc5, sdsc6, sdscos, sdscum, sdscump, sdsdelta1, sdsdelta2, sdsdth, sdset, sdsfacmtf, sdshck, sdsiso, sdsl, sdsmwd, sdsmwpow, sdsnmtf, sdsnuw, sdsp, sdsp1, sdsp2, sdspbk, sdsstrain, sdsstrain2, sdsstraina, seawnd, sed_d50_uniform, sed_d50file, sed_dstar, sedmapd50, setup_apply_wlv, sigdepth, sigma, sigmaucap, sina0, sinbr, sinfc, sintable, sintail1, sintail2, sinthp, sinws, snlcs1, snlcs2, snlcs3, solverthr_setup, spmss, stabof, stabsh, status, stdlat, stdlon, stdt, stdx, stdy, sth1mf, sth2mf, stk_wn, w3servmd::strace(), stxftf, stxftftail, stxftwn, swellf, swellf2, swellf3, swellf4, swellf5, swellf6, swellf7, swellfpar, swlb1, sxfr, symr, constants::tabu_fw(), taillev, tailnl, tailt1, tailt2, tailtype, tauwbug, tauwshelter, th1mf, th2mf, tmpmap, tmpsta, tname, trckcmpr, trnmx, trnmy, typeid, ucap, ugbccfl, ugobcauto, ugobcdepth, ugobcfile, ugobcok, uno3, unrot, unstscheme, unstschemes, us3d, usecgice, ussp, viscstress, vof, vsc, vsc0, w3nmlgridmd::w3nmlgrid(), w3gdatmd::w3nmod(), w3gdatmd::w3setg(), wcor1, wcor2, wdthcg, wdthth, whitecapdur, whitecapwidth, wnmeanp, wnmeanptail, wsc, wsm, x, xfilt, xgrdin, xlonac, xo, xo0, xp, xr, xseed, y, yesxno, ygrdin, yj0r, ylatac, yo, yo0, z0max, z0rat, zalp, zbin, zlim, and zwnd.

Referenced by ww3grid().

Variable Documentation

◆ a34

real w3gridmd::a34

Definition at line 672 of file w3gridmd.F90.

672  REAL :: A34, FHFC, DNM, FC1, FC2, FC3

Referenced by w3grid().

◆ aircmin

real w3gridmd::aircmin

Definition at line 814 of file w3gridmd.F90.

814  REAL :: AIRCMIN, AIRGB

Referenced by w3grid().

◆ airgb

real w3gridmd::airgb

Definition at line 814 of file w3gridmd.F90.

Referenced by w3grid().

◆ alpha0

real w3gridmd::alpha0

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ altlp

integer w3gridmd::altlp

Definition at line 890 of file w3gridmd.F90.

Referenced by w3grid().

◆ anglbdy

real, dimension(:), allocatable w3gridmd::anglbdy

Definition at line 696 of file w3gridmd.F90.

Referenced by w3grid().

◆ angldin

real, dimension(:,:), allocatable w3gridmd::angldin

Definition at line 694 of file w3gridmd.F90.

694  REAL, ALLOCATABLE :: AnglDin(:,:),StdLon(:,:),StdLat(:,:)

Referenced by w3grid().

◆ apm

real w3gridmd::apm

Definition at line 657 of file w3gridmd.F90.

Referenced by w3grid().

◆ arctic

logical w3gridmd::arctic

Definition at line 906 of file w3gridmd.F90.

Referenced by w3grid().

◆ averg

logical w3gridmd::averg

Definition at line 906 of file w3gridmd.F90.

Referenced by w3grid().

◆ bdylat

real, dimension(:), allocatable w3gridmd::bdylat

Definition at line 696 of file w3gridmd.F90.

Referenced by w3grid().

◆ bdylon

real, dimension(:), allocatable w3gridmd::bdylon

Definition at line 696 of file w3gridmd.F90.

696  REAL, ALLOCATABLE :: BDYLON(:), BDYLAT(:), &
697  ELatbdy(:), ELonbdy(:), Anglbdy(:)

Referenced by w3grid().

◆ betamax

real w3gridmd::betamax

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ bjalfa

real w3gridmd::bjalfa

Definition at line 897 of file w3gridmd.F90.

897  REAL :: BJALFA, BJGAM

Referenced by w3grid().

◆ bjflag

logical w3gridmd::bjflag

Definition at line 898 of file w3gridmd.F90.

898  LOGICAL :: BJFLAG

Referenced by w3grid().

◆ bjgam

real w3gridmd::bjgam

Definition at line 897 of file w3gridmd.F90.

Referenced by w3grid().

◆ botroughfac

real w3gridmd::botroughfac

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ botroughmin

real w3gridmd::botroughmin

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ bplat

real, dimension(9) w3gridmd::bplat

Definition at line 952 of file w3gridmd.F90.

952  REAL, DIMENSION(9) :: BPLAT, BPLON

Referenced by w3grid().

◆ bplon

real, dimension(9) w3gridmd::bplon

Definition at line 952 of file w3gridmd.F90.

Referenced by w3grid().

◆ bpolat

real w3gridmd::bpolat

Definition at line 699 of file w3gridmd.F90.

699  REAL :: bPolat, bPolon

Referenced by w3grid().

◆ bpolon

real w3gridmd::bpolon

Definition at line 699 of file w3gridmd.F90.

Referenced by w3grid().

◆ btbet

real w3gridmd::btbet

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ capcha

real w3gridmd::capcha

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ cdfac

real w3gridmd::cdfac

Definition at line 829 of file w3gridmd.F90.

829  REAL :: CDFAC

Referenced by w3grid().

◆ cdis

real w3gridmd::cdis

Definition at line 657 of file w3gridmd.F90.

Referenced by w3grid().

◆ cdmax

real w3gridmd::cdmax

Definition at line 826 of file w3gridmd.F90.

826  REAL :: CDMAX

Referenced by w3grid().

◆ cflsm

real w3gridmd::cflsm

Definition at line 905 of file w3gridmd.F90.

Referenced by w3grid().

◆ cfltm

real w3gridmd::cfltm

Definition at line 804 of file w3gridmd.F90.

804  REAL :: CFLTM, CICE0, CICEN, PMOVE, XFILT, &
805  LICE, XSEED, XR, HSPM, WSM, WSC, STDX,&
806  STDY, STDT, ICEHMIN, ICEHFAC, ICEHINIT, &
807  ICESLN, ICEWIND, ICESNL, ICESDS, &
808  ICEHDISP, ICEFDISP, ICEDDISP, BTBET

Referenced by w3grid().

◆ cha0

real w3gridmd::cha0

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ chamin

real w3gridmd::chamin

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ cice0

real w3gridmd::cice0

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ cicen

real w3gridmd::cicen

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ cinp

real w3gridmd::cinp

Definition at line 657 of file w3gridmd.F90.

657  REAL :: CINP, CDIS, APM

Referenced by w3grid().

◆ clin

real w3gridmd::clin

Definition at line 654 of file w3gridmd.F90.

654  REAL :: CLIN, RFPM, RFHF

Referenced by w3grid().

◆ cneg

real w3gridmd::cneg

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ comstr

character w3gridmd::comstr

Definition at line 782 of file w3gridmd.F90.

782  CHARACTER :: COMSTR*1, PNAME*30, RFORM*16, &
783  FROM*4, FNAME*60, TNAME*60, LINE*80, &
784  STATUS*20,FNAME2*60, PNAME2*40

Referenced by w3grid().

◆ connct

logical w3gridmd::connct

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ conv_dx

real (scrip_r8) w3gridmd::conv_dx

Definition at line 797 of file w3gridmd.F90.

797  REAL (SCRIP_R8) :: CONV_DX,CONV_DY,OFFSET

◆ conv_dy

real (scrip_r8) w3gridmd::conv_dy

Definition at line 797 of file w3gridmd.F90.

◆ cpos

real w3gridmd::cpos

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ crit_dep_setup

real*8 w3gridmd::crit_dep_setup

Definition at line 942 of file w3gridmd.F90.

942  real*8 :: crit_dep_setup

Referenced by w3grid().

◆ cstb1

logical w3gridmd::cstb1

Definition at line 872 of file w3gridmd.F90.

Referenced by w3grid().

◆ cstrg

character(len=4) w3gridmd::cstrg

Definition at line 637 of file w3gridmd.F90.

Referenced by w3grid().

◆ ctype

integer w3gridmd::ctype

Definition at line 825 of file w3gridmd.F90.

825  INTEGER :: CTYPE

Referenced by w3grid().

◆ cumsigp

real w3gridmd::cumsigp

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ depths

real, dimension(100) w3gridmd::depths

Definition at line 666 of file w3gridmd.F90.

Referenced by readnl().

◆ dnm

real w3gridmd::dnm

Definition at line 672 of file w3gridmd.F90.

Referenced by w3grid().

◆ dphid

real w3gridmd::dphid

Definition at line 660 of file w3gridmd.F90.

Referenced by w3grid().

◆ dptfac

real w3gridmd::dptfac

Definition at line 666 of file w3gridmd.F90.

666  REAL :: DPTFAC, DEPTHS(100)

Referenced by w3grid().

◆ dtime

real w3gridmd::dtime

Definition at line 901 of file w3gridmd.F90.

901  REAL :: DTIME

Referenced by w3grid().

◆ dtims

real w3gridmd::dtims

Definition at line 905 of file w3gridmd.F90.

905  REAL :: DTIMS, CFLSM, RFMAXD, SYMR, YJ0R

Referenced by w3grid().

◆ dvsmc

real w3gridmd::dvsmc

Definition at line 682 of file w3gridmd.F90.

682  REAL :: DVSMC

Referenced by w3grid().

◆ dxo

real w3gridmd::dxo

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ dyo

real w3gridmd::dyo

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ e3d

integer w3gridmd::e3d

Definition at line 642 of file w3gridmd.F90.

642  INTEGER :: E3D,I1E3D,I2E3D

Referenced by w3grid().

◆ elatac

real, dimension(:), allocatable w3gridmd::elatac

Definition at line 690 of file w3gridmd.F90.

Referenced by w3grid().

◆ elatbdy

real, dimension(:), allocatable w3gridmd::elatbdy

Definition at line 696 of file w3gridmd.F90.

Referenced by w3grid().

◆ elonac

real, dimension(:), allocatable w3gridmd::elonac

Definition at line 690 of file w3gridmd.F90.

Referenced by w3grid().

◆ elonbdy

real, dimension(:), allocatable w3gridmd::elonbdy

Definition at line 696 of file w3gridmd.F90.

Referenced by w3grid().

◆ expfsfct

logical w3gridmd::expfsfct

Definition at line 925 of file w3gridmd.F90.

925  LOGICAL :: EXPFSFCT

Referenced by w3grid().

◆ expfsn

logical w3gridmd::expfsn

Definition at line 923 of file w3gridmd.F90.

923  LOGICAL :: EXPFSN

Referenced by w3grid().

◆ expfspsi

logical w3gridmd::expfspsi

Definition at line 924 of file w3gridmd.F90.

924  LOGICAL :: EXPFSPSI

Referenced by w3grid().

◆ exptotal

logical w3gridmd::exptotal

Definition at line 927 of file w3gridmd.F90.

927  LOGICAL :: EXPTOTAL

Referenced by w3grid().

◆ facberg

real w3gridmd::facberg

Definition at line 723 of file w3gridmd.F90.

723  REAL :: FACBERG, REFSLOPE

Referenced by w3grid().

◆ fachf

real w3gridmd::fachf

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ factor

real w3gridmd::factor

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ fc1

real w3gridmd::fc1

Definition at line 672 of file w3gridmd.F90.

Referenced by w3grid().

◆ fc2

real w3gridmd::fc2

Definition at line 672 of file w3gridmd.F90.

Referenced by w3grid().

◆ fc3

real w3gridmd::fc3

Definition at line 672 of file w3gridmd.F90.

Referenced by w3grid().

◆ fhfc

real w3gridmd::fhfc

Definition at line 672 of file w3gridmd.F90.

Referenced by w3grid().

◆ first

logical w3gridmd::first

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flagtr

integer w3gridmd::flagtr

Definition at line 803 of file w3gridmd.F90.

803  INTEGER :: FLAGTR, IHM

Referenced by w3grid().

◆ flbs

logical w3gridmd::flbs

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flbt

logical w3gridmd::flbt

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flc

logical w3gridmd::flc

Definition at line 811 of file w3gridmd.F90.

811  LOGICAL :: FLC, ICEDISP, TRCKCMPR

Referenced by w3grid().

◆ fldb

logical w3gridmd::fldb

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flgnml

logical w3gridmd::flgnml

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flic

logical w3gridmd::flic

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flinds

logical w3gridmd::flinds

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flis

logical w3gridmd::flis

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ fllin

logical w3gridmd::fllin

Definition at line 713 of file w3gridmd.F90.

713  LOGICAL :: FLLIN, FLINDS, FLNL, FLBT, FLDB, &
714  FLTR, FLBS, FLPROP, FLREF, &
715  FIRST, CONNCT, FLNEW, INGRID,FLIC, &
716  FLIS, FLGNML

Referenced by w3grid().

◆ flnew

logical w3gridmd::flnew

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flnl

logical w3gridmd::flnl

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flnmlo

logical w3gridmd::flnmlo = .FALSE.

Definition at line 718 of file w3gridmd.F90.

718  LOGICAL :: FLNMLO = .false.

Referenced by w3grid().

◆ flprop

logical w3gridmd::flprop

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flref

logical w3gridmd::flref

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ flst4

logical w3gridmd::flst4 = .FALSE.

Definition at line 720 of file w3gridmd.F90.

720  LOGICAL :: FLST4 = .false.

Referenced by w3grid().

◆ flst6

logical w3gridmd::flst6 = .FALSE.

Definition at line 721 of file w3gridmd.F90.

721  LOGICAL :: FLST6 = .false.

Referenced by w3grid().

◆ flstb2

logical w3gridmd::flstb2 = .FALSE.

Definition at line 719 of file w3gridmd.F90.

719  LOGICAL :: FLSTB2 = .false.

Referenced by w3grid().

◆ fltc96

logical w3gridmd::fltc96 = .FALSE.

Definition at line 717 of file w3gridmd.F90.

717  LOGICAL :: FLTC96 = .false.

Referenced by w3grid().

◆ fltr

logical w3gridmd::fltr

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ fmiche

real w3gridmd::fmiche

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ fname

character w3gridmd::fname

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ fname2

character w3gridmd::fname2

Definition at line 782 of file w3gridmd.F90.

◆ fneg

real w3gridmd::fneg

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ fpia

real w3gridmd::fpia

Definition at line 660 of file w3gridmd.F90.

Referenced by w3grid().

◆ fpib

real w3gridmd::fpib

Definition at line 660 of file w3gridmd.F90.

Referenced by w3grid().

◆ fpos

real w3gridmd::fpos

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ from

character w3gridmd::from

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ fxfm3

real w3gridmd::fxfm3

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ fxfmage

real w3gridmd::fxfmage

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ fxpm3

real w3gridmd::fxpm3

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ gamma

real w3gridmd::gamma

Definition at line 675 of file w3gridmd.F90.

675  REAL :: GAMMA

Referenced by w3grid().

◆ gqamp1

real w3gridmd::gqamp1

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqamp2

real w3gridmd::gqamp2

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqamp3

real w3gridmd::gqamp3

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqamp4

real w3gridmd::gqamp4

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqmnf1

integer w3gridmd::gqmnf1

Definition at line 878 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqmnq_om2

integer w3gridmd::gqmnq_om2

Definition at line 878 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqmnt1

integer w3gridmd::gqmnt1

Definition at line 878 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqmthrcou

real w3gridmd::gqmthrcou

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ gqmthrsat

real w3gridmd::gqmthrsat

Definition at line 879 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_area_varid

integer w3gridmd::grid_area_varid

Definition at line 795 of file w3gridmd.F90.

795  INTEGER :: grid_area_varid, grid_imask_varid

◆ grid_center_lat_varid

integer w3gridmd::grid_center_lat_varid

Definition at line 793 of file w3gridmd.F90.

793  INTEGER :: grid_center_lat_varid, grid_center_lon_varid

Referenced by w3grid().

◆ grid_center_lon_varid

integer w3gridmd::grid_center_lon_varid

Definition at line 793 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_corner_lat_varid

integer w3gridmd::grid_corner_lat_varid

Definition at line 794 of file w3gridmd.F90.

794  INTEGER :: grid_corner_lat_varid, grid_corner_lon_varid

Referenced by w3grid().

◆ grid_corner_lon_varid

integer w3gridmd::grid_corner_lon_varid

Definition at line 794 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_corners_dimid

integer w3gridmd::grid_corners_dimid

Definition at line 792 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_dims_varid

integer w3gridmd::grid_dims_varid

Definition at line 796 of file w3gridmd.F90.

796  INTEGER :: grid_dims_varid

Referenced by w3grid().

◆ grid_imask_varid

integer w3gridmd::grid_imask_varid

Definition at line 795 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_rank_dimid

integer w3gridmd::grid_rank_dimid

Definition at line 792 of file w3gridmd.F90.

Referenced by w3grid().

◆ grid_size_dimid

integer w3gridmd::grid_size_dimid

Definition at line 792 of file w3gridmd.F90.

792  INTEGER :: grid_size_dimid, grid_rank_dimid, grid_corners_dimid

Referenced by w3grid().

◆ gshift

real(8) w3gridmd::gshift

Definition at line 810 of file w3gridmd.F90.

810  REAL(8) :: GSHIFT ! see notes in WMGHGH

Referenced by w3grid().

◆ gstrg

character(len=4) w3gridmd::gstrg

Definition at line 637 of file w3gridmd.F90.

637  CHARACTER(LEN=4) :: GSTRG, CSTRG

Referenced by w3grid().

◆ hspm

real w3gridmd::hspm

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ i

integer w3gridmd::i

Definition at line 582 of file w3gridmd.F90.

Referenced by readnl(), and w3grid().

◆ i1e3d

integer w3gridmd::i1e3d

Definition at line 642 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1p2sf

integer w3gridmd::i1p2sf

Definition at line 641 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1sth1m

integer w3gridmd::i1sth1m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1sth2m

integer w3gridmd::i1sth2m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1th1m

integer w3gridmd::i1th1m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1th2m

integer w3gridmd::i1th2m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i1us3d

integer w3gridmd::i1us3d

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2e3d

integer w3gridmd::i2e3d

Definition at line 642 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2p2sf

integer w3gridmd::i2p2sf

Definition at line 641 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2sth1m

integer w3gridmd::i2sth1m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2sth2m

integer w3gridmd::i2sth2m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2th1m

integer w3gridmd::i2th1m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2th2m

integer w3gridmd::i2th2m

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ i2us3d

integer w3gridmd::i2us3d

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ iba

integer w3gridmd::iba

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ibi

integer w3gridmd::ibi

Definition at line 599 of file w3gridmd.F90.

599  INTEGER :: IBI, IP0, IPN, IPH, IPI

Referenced by w3grid().

◆ ic2disper

logical w3gridmd::ic2disper

Definition at line 754 of file w3gridmd.F90.

754  LOGICAL :: IC2DISPER

Referenced by w3grid().

◆ ic2dmax

real w3gridmd::ic2dmax

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic2reynolds

real w3gridmd::ic2reynolds

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic2rough

real w3gridmd::ic2rough

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic2smooth

real w3gridmd::ic2smooth

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic2turb

real w3gridmd::ic2turb

Definition at line 755 of file w3gridmd.F90.

755  REAL :: IC2TURB, IC2ROUGH, IC2REYNOLDS, &
756  IC2SMOOTH, IC2VISC, IC2TURBS, IC2DMAX

Referenced by w3grid().

◆ ic2turbs

real w3gridmd::ic2turbs

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic2visc

real w3gridmd::ic2visc

Definition at line 755 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3cheng

logical w3gridmd::ic3cheng

Definition at line 765 of file w3gridmd.F90.

765  LOGICAL :: IC3CHENG,USECGICE

Referenced by w3grid().

◆ ic3dens

real w3gridmd::ic3dens

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3elas

real w3gridmd::ic3elas

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3hice

real w3gridmd::ic3hice

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3hilim

real w3gridmd::ic3hilim

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3kilim

real w3gridmd::ic3kilim

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3maxcnc

real w3gridmd::ic3maxcnc

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3maxthk

real w3gridmd::ic3maxthk

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic3visc

real w3gridmd::ic3visc

Definition at line 760 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic4cn

real, dimension(nic42) w3gridmd::ic4cn

Definition at line 770 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic4fc

real, dimension(nic4) w3gridmd::ic4fc

Definition at line 770 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic4fmin

real w3gridmd::ic4fmin

Definition at line 770 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic4ki

real, dimension(nic4) w3gridmd::ic4ki

Definition at line 770 of file w3gridmd.F90.

770  REAL :: IC4KI(NIC4), IC4FC(NIC4), &
771  IC4CN(NIC42), IC4FMIN, IC4KIBK

Referenced by w3grid().

◆ ic4kibk

real w3gridmd::ic4kibk

Definition at line 770 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic4method

integer w3gridmd::ic4method

Definition at line 769 of file w3gridmd.F90.

769  INTEGER :: IC4METHOD

Referenced by w3grid().

◆ ic5kfilter

real w3gridmd::ic5kfilter

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5maxiter

real w3gridmd::ic5maxiter

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5maxki

real w3gridmd::ic5maxki

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5maxkratio

real w3gridmd::ic5maxkratio

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5minhw

real w3gridmd::ic5minhw

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5minig

real w3gridmd::ic5minig

Definition at line 775 of file w3gridmd.F90.

775  REAL :: IC5MINIG, IC5MINWT, &
776  IC5MAXKRATIO, IC5MAXKI, IC5MINHW, &
777  IC5MAXITER, IC5RKICK, IC5KFILTER, &
778  IC5VEMOD

Referenced by w3grid().

◆ ic5minwt

real w3gridmd::ic5minwt

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5mstr

character(len=4), dimension(3) w3gridmd::ic5mstr = (/' EFS', ' RP ', ' M2 '/)

Definition at line 779 of file w3gridmd.F90.

779  CHARACTER(LEN=4) :: IC5MSTR(3) = (/' EFS', ' RP ', ' M2 '/)

Referenced by w3grid().

◆ ic5rkick

real w3gridmd::ic5rkick

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ ic5vemod

real w3gridmd::ic5vemod

Definition at line 775 of file w3gridmd.F90.

Referenced by w3grid().

◆ iceddisp

real w3gridmd::iceddisp

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icedisp

logical w3gridmd::icedisp

Definition at line 811 of file w3gridmd.F90.

Referenced by w3grid().

◆ icefdisp

real w3gridmd::icefdisp

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icehdisp

real w3gridmd::icehdisp

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icehfac

real w3gridmd::icehfac

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icehinit

real w3gridmd::icehinit

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icehmin

real w3gridmd::icehmin

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icesds

real w3gridmd::icesds

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icesln

real w3gridmd::icesln

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icesnl

real w3gridmd::icesnl

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ icewind

real w3gridmd::icewind

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ idepth

integer w3gridmd::idepth

Definition at line 596 of file w3gridmd.F90.

596  INTEGER :: IDEPTH

Referenced by w3grid().

◆ idfm

integer w3gridmd::idfm

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ idft

integer w3gridmd::idft

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ idla

integer w3gridmd::idla

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ idx

integer w3gridmd::idx

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ idy

integer w3gridmd::idy

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ient

integer, save w3gridmd::ient = 0

Definition at line 622 of file w3gridmd.F90.

622  INTEGER, SAVE :: IENT = 0

Referenced by readnl(), and w3grid().

◆ ierr

integer w3gridmd::ierr

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ifile

integer w3gridmd::ifile

Definition at line 619 of file w3gridmd.F90.

619  INTEGER :: IFILE

Referenced by w3grid().

◆ ifl

integer w3gridmd::ifl

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ igaddoutp

integer w3gridmd::igaddoutp

Definition at line 747 of file w3gridmd.F90.

Referenced by w3grid().

◆ igbcoverwrite

logical w3gridmd::igbcoverwrite

Definition at line 746 of file w3gridmd.F90.

Referenced by w3grid().

◆ igempirical

real w3gridmd::igempirical

Definition at line 749 of file w3gridmd.F90.

Referenced by w3grid().

◆ igfixeddepth

real w3gridmd::igfixeddepth

Definition at line 749 of file w3gridmd.F90.

Referenced by w3grid().

◆ igkdmin

real w3gridmd::igkdmin

Definition at line 749 of file w3gridmd.F90.

Referenced by w3grid().

◆ igmaxdep

real w3gridmd::igmaxdep

Definition at line 749 of file w3gridmd.F90.

Referenced by w3grid().

◆ igmaxfreq

real w3gridmd::igmaxfreq

Definition at line 749 of file w3gridmd.F90.

749  REAL :: IGMAXFREQ, IGMINDEP, IGMAXDEP, &
750  IGKDMIN, IGFIXEDDEPTH, IGEMPIRICAL

Referenced by w3grid().

◆ igmethod

integer w3gridmd::igmethod

Definition at line 747 of file w3gridmd.F90.

747  INTEGER :: IGMETHOD, IGADDOUTP, IGSOURCE, &
748  IGSOURCEATBP, IGSTERMS

Referenced by w3grid().

◆ igmindep

real w3gridmd::igmindep

Definition at line 749 of file w3gridmd.F90.

Referenced by w3grid().

◆ igsource

integer w3gridmd::igsource

Definition at line 747 of file w3gridmd.F90.

Referenced by w3grid().

◆ igsourceatbp

integer w3gridmd::igsourceatbp

Definition at line 747 of file w3gridmd.F90.

Referenced by w3grid().

◆ igsterms

integer w3gridmd::igsterms

Definition at line 747 of file w3gridmd.F90.

Referenced by w3grid().

◆ igswellmax

logical w3gridmd::igswellmax

Definition at line 746 of file w3gridmd.F90.

746  LOGICAL :: IGSWELLMAX, IGBCOVERWRITE

Referenced by w3grid().

◆ ihm

integer w3gridmd::ihm

Definition at line 803 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkcelac

integer, dimension(:,:), allocatable w3gridmd::ijkcelac

Definition at line 688 of file w3gridmd.F90.

688  INTEGER, ALLOCATABLE :: IJKCelAC(:,:),IJKUFcAC(:,:),IJKVFcAC(:,:)

Referenced by w3grid().

◆ ijkcelin

integer, dimension(:,:), allocatable w3gridmd::ijkcelin

Definition at line 685 of file w3gridmd.F90.

685  INTEGER, ALLOCATABLE :: IJKCelin(:,:),IJKUFcin(:,:),IJKVFcin(:,:)

Referenced by w3grid().

◆ ijkdep

integer, dimension(:), allocatable w3gridmd::ijkdep

Definition at line 689 of file w3gridmd.F90.

689  INTEGER, ALLOCATABLE :: IJKDep(:), IJKVFc8(:)

Referenced by w3grid().

◆ ijkobstr

integer, dimension(:,:), allocatable w3gridmd::ijkobstr

Definition at line 686 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkufcac

integer, dimension(:,:), allocatable w3gridmd::ijkufcac

Definition at line 688 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkufcin

integer, dimension(:,:), allocatable w3gridmd::ijkufcin

Definition at line 685 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkvfc8

integer, dimension(:), allocatable w3gridmd::ijkvfc8

Definition at line 689 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkvfcac

integer, dimension(:,:), allocatable w3gridmd::ijkvfcac

Definition at line 688 of file w3gridmd.F90.

Referenced by w3grid().

◆ ijkvfcin

integer, dimension(:,:), allocatable w3gridmd::ijkvfcin

Definition at line 685 of file w3gridmd.F90.

Referenced by w3grid().

◆ ik

integer w3gridmd::ik

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iloop

integer w3gridmd::iloop

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ imap

integer w3gridmd::imap

Definition at line 613 of file w3gridmd.F90.

Referenced by w3grid().

◆ imapb

integer w3gridmd::imapb

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ impfreqshift

logical w3gridmd::impfreqshift

Definition at line 930 of file w3gridmd.F90.

930  LOGICAL :: IMPFREQSHIFT

Referenced by w3grid().

◆ impfsn

logical w3gridmd::impfsn

Definition at line 926 of file w3gridmd.F90.

926  LOGICAL :: IMPFSN

Referenced by w3grid().

◆ imprefraction

logical w3gridmd::imprefraction

Definition at line 929 of file w3gridmd.F90.

929  LOGICAL :: IMPREFRACTION

Referenced by w3grid().

◆ impsource

logical w3gridmd::impsource

Definition at line 931 of file w3gridmd.F90.

931  LOGICAL :: IMPSOURCE

Referenced by w3grid().

◆ imptotal

logical w3gridmd::imptotal

Definition at line 928 of file w3gridmd.F90.

928  LOGICAL :: IMPTOTAL

Referenced by w3grid().

◆ indtsa

integer w3gridmd::indtsa

Definition at line 890 of file w3gridmd.F90.

890  INTEGER :: INDTSA, ALTLP

Referenced by w3grid().

◆ ingrid

logical w3gridmd::ingrid

Definition at line 713 of file w3gridmd.F90.

Referenced by w3grid().

◆ ip

integer w3gridmd::ip

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ip0

integer w3gridmd::ip0

Definition at line 599 of file w3gridmd.F90.

Referenced by w3grid().

◆ iph

integer w3gridmd::iph

Definition at line 599 of file w3gridmd.F90.

Referenced by w3grid().

◆ ipi

integer w3gridmd::ipi

Definition at line 599 of file w3gridmd.F90.

Referenced by w3grid().

◆ ipn

integer w3gridmd::ipn

Definition at line 599 of file w3gridmd.F90.

Referenced by w3grid().

◆ iqtype

integer w3gridmd::iqtype

Definition at line 878 of file w3gridmd.F90.

878  INTEGER :: IQTYPE, GQMNF1, GQMNT1, GQMNQ_OM2

Referenced by w3grid().

◆ is2andisb

logical w3gridmd::is2andisb

Definition at line 734 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2andisd

real w3gridmd::is2andisd

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2andise

real w3gridmd::is2andise

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2andisn

real w3gridmd::is2andisn

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2backscat

real w3gridmd::is2backscat

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2break

logical w3gridmd::is2break

Definition at line 734 of file w3gridmd.F90.

734  LOGICAL :: IS2BREAK, IS2DISP, IS2DUPDATE, &
735  IS2ISOSCAT, IS2ANDISB

Referenced by w3grid().

◆ is2breake

real w3gridmd::is2breake

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2breakf

real w3gridmd::is2breakf

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2c2

real w3gridmd::is2c2

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2c3

real w3gridmd::is2c3

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2conc

real w3gridmd::is2conc

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2creepb

real w3gridmd::is2creepb

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2creepc

real w3gridmd::is2creepc

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2creepd

real w3gridmd::is2creepd

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2creepn

real w3gridmd::is2creepn

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2damp

real w3gridmd::is2damp

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2disp

logical w3gridmd::is2disp

Definition at line 734 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2dmin

real w3gridmd::is2dmin

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2dupdate

logical w3gridmd::is2dupdate

Definition at line 734 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2flexstr

real w3gridmd::is2flexstr

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2fragility

real w3gridmd::is2fragility

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2isoscat

logical w3gridmd::is2isoscat

Definition at line 734 of file w3gridmd.F90.

Referenced by w3grid().

◆ is2wim1

real w3gridmd::is2wim1

Definition at line 728 of file w3gridmd.F90.

Referenced by w3grid().

◆ isc1

real w3gridmd::isc1

Definition at line 725 of file w3gridmd.F90.

725  REAL :: ISC1, ISC2

Referenced by w3grid().

◆ isc2

real w3gridmd::isc2

Definition at line 725 of file w3gridmd.F90.

Referenced by w3grid().

◆ isea

integer w3gridmd::isea

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iseai

integer, dimension(4) w3gridmd::iseai

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ishft

integer w3gridmd::ishft

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ isp

integer w3gridmd::isp

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ist

integer w3gridmd::ist

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ith

integer w3gridmd::ith

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ith0

integer w3gridmd::ith0

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iussp

integer w3gridmd::iussp

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ ix

integer w3gridmd::ix

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ix0

integer w3gridmd::ix0

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ix1

integer w3gridmd::ix1

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ix2

integer w3gridmd::ix2

Definition at line 582 of file w3gridmd.F90.

◆ ix3

integer w3gridmd::ix3

Definition at line 616 of file w3gridmd.F90.

616  INTEGER :: IX3, IY3

Referenced by w3grid().

◆ ixn

integer w3gridmd::ixn

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ixo

integer w3gridmd::ixo

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ixr

integer, dimension(4) w3gridmd::ixr

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iy

integer w3gridmd::iy

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iy1

integer w3gridmd::iy1

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iy2

integer w3gridmd::iy2

Definition at line 582 of file w3gridmd.F90.

◆ iy3

integer w3gridmd::iy3

Definition at line 616 of file w3gridmd.F90.

Referenced by w3grid().

◆ iyn

integer, dimension(nfl) w3gridmd::iyn

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iyo

integer w3gridmd::iyo

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ iyr

integer, dimension(4) w3gridmd::iyr

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ j

integer w3gridmd::j

Definition at line 582 of file w3gridmd.F90.

Referenced by readnl(), and w3grid().

◆ jeqt

integer w3gridmd::jeqt

Definition at line 608 of file w3gridmd.F90.

608  INTEGER :: JEQT, LvSMC, NBISMC, JS, NCObst, JObs, ISHFT

Referenced by w3grid().

◆ jgs_block_gauss_seidel

logical w3gridmd::jgs_block_gauss_seidel

Definition at line 918 of file w3gridmd.F90.

918  LOGICAL :: JGS_BLOCK_GAUSS_SEIDEL

Referenced by w3grid().

◆ jgs_diff_thr

real*8 w3gridmd::jgs_diff_thr

Definition at line 939 of file w3gridmd.F90.

939  real*8 :: jgs_diff_thr

Referenced by w3grid().

◆ jgs_limiter

logical w3gridmd::jgs_limiter

Definition at line 916 of file w3gridmd.F90.

916  LOGICAL :: JGS_LIMITER

Referenced by w3grid().

◆ jgs_limiter_func

integer w3gridmd::jgs_limiter_func

Definition at line 917 of file w3gridmd.F90.

917  INTEGER :: JGS_LIMITER_FUNC

Referenced by w3grid().

◆ jgs_maxiter

integer w3gridmd::jgs_maxiter

Definition at line 933 of file w3gridmd.F90.

933  INTEGER :: JGS_MAXITER

Referenced by w3grid().

◆ jgs_nlevel

integer w3gridmd::jgs_nlevel

Definition at line 937 of file w3gridmd.F90.

937  INTEGER :: JGS_NLEVEL

Referenced by w3grid().

◆ jgs_norm_thr

real*8 w3gridmd::jgs_norm_thr

Definition at line 940 of file w3gridmd.F90.

940  real*8 :: jgs_norm_thr

Referenced by w3grid().

◆ jgs_pmin

real*8 w3gridmd::jgs_pmin

Definition at line 938 of file w3gridmd.F90.

938  real*8 :: jgs_pmin

Referenced by w3grid().

◆ jgs_source_nonlinear

logical w3gridmd::jgs_source_nonlinear

Definition at line 920 of file w3gridmd.F90.

920  LOGICAL :: JGS_SOURCE_NONLINEAR

Referenced by w3grid().

◆ jgs_terminate_difference

logical w3gridmd::jgs_terminate_difference

Definition at line 914 of file w3gridmd.F90.

914  LOGICAL :: JGS_TERMINATE_DIFFERENCE

Referenced by w3grid().

◆ jgs_terminate_maxiter

logical w3gridmd::jgs_terminate_maxiter

Definition at line 913 of file w3gridmd.F90.

913  LOGICAL :: JGS_TERMINATE_MAXITER

Referenced by w3grid().

◆ jgs_terminate_norm

logical w3gridmd::jgs_terminate_norm

Definition at line 915 of file w3gridmd.F90.

915  LOGICAL :: JGS_TERMINATE_NORM

Referenced by w3grid().

◆ jgs_use_jacobi

logical w3gridmd::jgs_use_jacobi

Definition at line 919 of file w3gridmd.F90.

919  LOGICAL :: JGS_USE_JACOBI

Referenced by w3grid().

◆ jj

integer w3gridmd::jj

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ jobs

integer w3gridmd::jobs

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ js

integer w3gridmd::js

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ kdconv

real w3gridmd::kdconv

Definition at line 876 of file w3gridmd.F90.

Referenced by w3grid().

◆ kdfd

real w3gridmd::kdfd

Definition at line 887 of file w3gridmd.F90.

Referenced by w3grid().

◆ kdfs

real w3gridmd::kdfs

Definition at line 887 of file w3gridmd.F90.

Referenced by w3grid().

◆ kdmin

real w3gridmd::kdmin

Definition at line 876 of file w3gridmd.F90.

Referenced by w3grid().

◆ lambda

real w3gridmd::lambda

Definition at line 876 of file w3gridmd.F90.

876  REAL :: LAMBDA, KDCONV, KDMIN, &
877  SNLCS1, SNLCS2, SNLCS3

Referenced by w3grid().

◆ latmin

real w3gridmd::latmin

Definition at line 678 of file w3gridmd.F90.

678  REAL :: LATMIN

Referenced by w3grid().

◆ lice

real w3gridmd::lice

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ line

character w3gridmd::line

Definition at line 782 of file w3gridmd.F90.

Referenced by readnl(), and w3grid().

◆ lvsmc

integer w3gridmd::lvsmc

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ mapout

integer, dimension(:,:), allocatable w3gridmd::mapout

Definition at line 627 of file w3gridmd.F90.

627  INTEGER, ALLOCATABLE :: MAPOUT(:,:)

Referenced by w3grid().

◆ msc

real w3gridmd::msc

Definition at line 887 of file w3gridmd.F90.

887  REAL :: MSC, NSC, KDFD, KDFS

Referenced by w3grid().

◆ naui

integer w3gridmd::naui

Definition at line 609 of file w3gridmd.F90.

Referenced by w3grid().

◆ navj

integer w3gridmd::navj

Definition at line 609 of file w3gridmd.F90.

Referenced by w3grid().

◆ nba

integer w3gridmd::nba

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nbicelin

integer, dimension(:), allocatable w3gridmd::nbicelin

Definition at line 686 of file w3gridmd.F90.

686  INTEGER, ALLOCATABLE :: NBICelin(:), IJKObstr(:,:)

Referenced by w3grid().

◆ nbismc

integer w3gridmd::nbismc

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ nbotot

integer w3gridmd::nbotot

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nbsel

integer w3gridmd::nbsel

Definition at line 934 of file w3gridmd.F90.

934  INTEGER :: nbSel

Referenced by w3grid().

◆ nbt

integer w3gridmd::nbt

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ncid

integer w3gridmd::ncid

Definition at line 791 of file w3gridmd.F90.

791  INTEGER :: NCID

Referenced by w3grid().

◆ ncobst

integer w3gridmd::ncobst

Definition at line 608 of file w3gridmd.F90.

Referenced by w3grid().

◆ ncol

integer w3gridmd::ncol = 78

Definition at line 601 of file w3gridmd.F90.

601  INTEGER :: NCOL = 78

Referenced by w3grid().

◆ ndepth

integer w3gridmd::ndepth

Definition at line 882 of file w3gridmd.F90.

Referenced by readnl(), and w3grid().

◆ ndsg

integer w3gridmd::ndsg

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ndsi

integer w3gridmd::ndsi

Definition at line 582 of file w3gridmd.F90.

582  INTEGER :: NDSI, NDSI2, NDSS, NDSM, NDSG, NDSTR,&
583  IERR, NDSTRC, NTRACE, ITH, IK, ITH0, &
584  ISP, IYN(NFL), NRLIN, NRSRCE, NRNL, &
585  NRBT, NRDB, NRTR, NRBS, NRPROP, &
586  IDLA, IDFM, IX0, IXN, IX, IY, ISEA, &
587  IDX, IXO, IDY, IYO, IBA, NBA, ILOOP, &
588  IFL, NBOTOT, NPO, IP, IX1, IX2, IY1, &
589  IY2, J, JJ, IXR(4), IYR(4), ISEAI(4),&
590  IST, NKI, NTHI, NRIC, NRIS, I, IDFT, &
591  NSTAT, NBT, NLAND, NOSW, NMAPB, IMAPB

Referenced by w3grid().

◆ ndsi2

integer w3gridmd::ndsi2

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ndsm

integer w3gridmd::ndsm

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ndsma

integer w3gridmd::ndsma

Definition at line 593 of file w3gridmd.F90.

593  INTEGER :: NDSMA

Referenced by w3grid().

◆ ndss

integer w3gridmd::ndss

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ndstr

integer w3gridmd::ndstr

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ndstrc

integer w3gridmd::ndstrc

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nfl

integer, parameter w3gridmd::nfl = 6

Definition at line 581 of file w3gridmd.F90.

581  INTEGER, PARAMETER :: NFL = 6

Referenced by w3grid().

◆ ngui

integer w3gridmd::ngui

Definition at line 609 of file w3gridmd.F90.

609  INTEGER :: NGUI, NGVJ, NAUI, NAVJ

Referenced by w3grid().

◆ ngvj

integer w3gridmd::ngvj

Definition at line 609 of file w3gridmd.F90.

Referenced by w3grid().

◆ nki

integer w3gridmd::nki

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nl5dis

integer w3gridmd::nl5dis

Definition at line 894 of file w3gridmd.F90.

894  INTEGER :: NL5DIS, NL5KEV, NL5IPL, NL5PMX

Referenced by w3grid().

◆ nl5dpt

real w3gridmd::nl5dpt

Definition at line 893 of file w3gridmd.F90.

893  REAL :: NL5DPT, NL5OML

Referenced by w3grid().

◆ nl5ipl

integer w3gridmd::nl5ipl

Definition at line 894 of file w3gridmd.F90.

Referenced by w3grid().

◆ nl5kev

integer w3gridmd::nl5kev

Definition at line 894 of file w3gridmd.F90.

Referenced by w3grid().

◆ nl5oml

real w3gridmd::nl5oml

Definition at line 893 of file w3gridmd.F90.

Referenced by w3grid().

◆ nl5pmx

integer w3gridmd::nl5pmx

Definition at line 894 of file w3gridmd.F90.

Referenced by w3grid().

◆ nland

integer w3gridmd::nland

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nlprop

real w3gridmd::nlprop

Definition at line 663 of file w3gridmd.F90.

663  REAL :: NLPROP

Referenced by w3grid().

◆ nlvcelsk

integer, dimension(:), allocatable w3gridmd::nlvcelsk

Definition at line 684 of file w3gridmd.F90.

684  INTEGER, ALLOCATABLE :: NLvCelsk(:), NLvUFcsk(:), NLvVFcsk(:)

Referenced by w3grid().

◆ nlvufcsk

integer, dimension(:), allocatable w3gridmd::nlvufcsk

Definition at line 684 of file w3gridmd.F90.

Referenced by w3grid().

◆ nlvvfcsk

integer, dimension(:), allocatable w3gridmd::nlvvfcsk

Definition at line 684 of file w3gridmd.F90.

Referenced by w3grid().

◆ nmap

integer w3gridmd::nmap

Definition at line 613 of file w3gridmd.F90.

613  INTEGER :: NMAP, IMAP

Referenced by w3grid().

◆ nmapb

integer w3gridmd::nmapb

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nml_curv

type(nml_curv_t) w3gridmd::nml_curv

Definition at line 565 of file w3gridmd.F90.

565  TYPE(NML_CURV_T) :: NML_CURV

Referenced by w3grid().

◆ nml_depth

type(nml_depth_t) w3gridmd::nml_depth

Definition at line 568 of file w3gridmd.F90.

568  TYPE(NML_DEPTH_T) :: NML_DEPTH

Referenced by w3grid().

◆ nml_excl_body

type(nml_excl_body_t), dimension(:), allocatable w3gridmd::nml_excl_body

Definition at line 577 of file w3gridmd.F90.

577  TYPE(NML_EXCL_BODY_T), ALLOCATABLE :: NML_EXCL_BODY(:)

Referenced by w3grid().

◆ nml_excl_count

type(nml_excl_count_t) w3gridmd::nml_excl_count

Definition at line 575 of file w3gridmd.F90.

575  TYPE(NML_EXCL_COUNT_T) :: NML_EXCL_COUNT

Referenced by w3grid().

◆ nml_excl_point

type(nml_excl_point_t), dimension(:), allocatable w3gridmd::nml_excl_point

Definition at line 576 of file w3gridmd.F90.

576  TYPE(NML_EXCL_POINT_T), ALLOCATABLE :: NML_EXCL_POINT(:)

Referenced by w3grid().

◆ nml_grid

type(nml_grid_t) w3gridmd::nml_grid

Definition at line 563 of file w3gridmd.F90.

563  TYPE(NML_GRID_T) :: NML_GRID

Referenced by w3grid().

◆ nml_inbnd_count

type(nml_inbnd_count_t) w3gridmd::nml_inbnd_count

Definition at line 573 of file w3gridmd.F90.

573  TYPE(NML_INBND_COUNT_T) :: NML_INBND_COUNT

Referenced by w3grid().

◆ nml_inbnd_point

type(nml_inbnd_point_t), dimension(:), allocatable w3gridmd::nml_inbnd_point

Definition at line 574 of file w3gridmd.F90.

574  TYPE(NML_INBND_POINT_T), ALLOCATABLE :: NML_INBND_POINT(:)

Referenced by w3grid().

◆ nml_mask

type(nml_mask_t) w3gridmd::nml_mask

Definition at line 569 of file w3gridmd.F90.

569  TYPE(NML_MASK_T) :: NML_MASK

Referenced by w3grid().

◆ nml_obst

type(nml_obst_t) w3gridmd::nml_obst

Definition at line 570 of file w3gridmd.F90.

570  TYPE(NML_OBST_T) :: NML_OBST

Referenced by w3grid().

◆ nml_outbnd_count

type(nml_outbnd_count_t) w3gridmd::nml_outbnd_count

Definition at line 578 of file w3gridmd.F90.

578  TYPE(NML_OUTBND_COUNT_T) :: NML_OUTBND_COUNT

Referenced by w3grid().

◆ nml_outbnd_line

type(nml_outbnd_line_t), dimension(:), allocatable w3gridmd::nml_outbnd_line

Definition at line 579 of file w3gridmd.F90.

579  TYPE(NML_OUTBND_LINE_T), ALLOCATABLE :: NML_OUTBND_LINE(:)

Referenced by w3grid().

◆ nml_rect

type(nml_rect_t) w3gridmd::nml_rect

Definition at line 564 of file w3gridmd.F90.

564  TYPE(NML_RECT_T) :: NML_RECT

Referenced by w3grid().

◆ nml_run

type(nml_run_t) w3gridmd::nml_run

Definition at line 561 of file w3gridmd.F90.

561  TYPE(NML_RUN_T) :: NML_RUN

Referenced by w3grid().

◆ nml_sed

type(nml_sed_t) w3gridmd::nml_sed

Definition at line 572 of file w3gridmd.F90.

572  TYPE(NML_SED_T) :: NML_SED

Referenced by w3grid().

◆ nml_slope

type(nml_slope_t) w3gridmd::nml_slope

Definition at line 571 of file w3gridmd.F90.

571  TYPE(NML_SLOPE_T) :: NML_SLOPE

Referenced by w3grid().

◆ nml_smc

type(nml_smc_t) w3gridmd::nml_smc

Definition at line 567 of file w3gridmd.F90.

567  TYPE(NML_SMC_T) :: NML_SMC

Referenced by w3grid().

◆ nml_spectrum

type(nml_spectrum_t) w3gridmd::nml_spectrum

Definition at line 560 of file w3gridmd.F90.

560  TYPE(NML_SPECTRUM_T) :: NML_SPECTRUM

Referenced by w3grid().

◆ nml_timesteps

type(nml_timesteps_t) w3gridmd::nml_timesteps

Definition at line 562 of file w3gridmd.F90.

562  TYPE(NML_TIMESTEPS_T) :: NML_TIMESTEPS

Referenced by w3grid().

◆ nml_unst

type(nml_unst_t) w3gridmd::nml_unst

Definition at line 566 of file w3gridmd.F90.

566  TYPE(NML_UNST_T) :: NML_UNST

Referenced by w3grid().

◆ nosw

integer w3gridmd::nosw

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ npo

integer w3gridmd::npo

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nqdef

integer w3gridmd::nqdef

Definition at line 886 of file w3gridmd.F90.

886  INTEGER :: NQDEF

Referenced by readnl(), and w3grid().

◆ nrbs

integer w3gridmd::nrbs

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrbt

integer w3gridmd::nrbt

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrdb

integer w3gridmd::nrdb

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nric

integer w3gridmd::nric

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nris

integer w3gridmd::nris

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrlin

integer w3gridmd::nrlin

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrnl

integer w3gridmd::nrnl

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrprop

integer w3gridmd::nrprop

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrsrce

integer w3gridmd::nrsrce

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nrtr

integer w3gridmd::nrtr

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nsc

real w3gridmd::nsc

Definition at line 887 of file w3gridmd.F90.

Referenced by w3grid().

◆ nstat

integer w3gridmd::nstat

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ nthi

integer w3gridmd::nthi

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ ntrace

integer w3gridmd::ntrace

Definition at line 582 of file w3gridmd.F90.

Referenced by w3grid().

◆ obsx

real, dimension(:,:), allocatable w3gridmd::obsx

Definition at line 703 of file w3gridmd.F90.

Referenced by w3grid().

◆ obsy

real, dimension(:,:), allocatable w3gridmd::obsy

Definition at line 703 of file w3gridmd.F90.

Referenced by w3grid().

◆ offset

real (scrip_r8) w3gridmd::offset

Definition at line 797 of file w3gridmd.F90.

◆ p2sf

integer w3gridmd::p2sf

Definition at line 641 of file w3gridmd.F90.

641  INTEGER :: P2SF,I1P2SF,I2P2SF

Referenced by w3grid().

◆ phimin

real w3gridmd::phimin

Definition at line 660 of file w3gridmd.F90.

660  REAL :: PHIMIN, FPIA, FPIB, DPHID

Referenced by w3grid().

◆ plat

real w3gridmd::plat

Definition at line 949 of file w3gridmd.F90.

949  REAL :: PLAT, PLON

Referenced by w3grid().

◆ plon

real w3gridmd::plon

Definition at line 949 of file w3gridmd.F90.

Referenced by w3grid().

◆ pmnam2

character w3gridmd::pmnam2

Definition at line 815 of file w3gridmd.F90.

Referenced by w3grid().

◆ pmname

character w3gridmd::pmname

Definition at line 815 of file w3gridmd.F90.

815  CHARACTER :: PMNAME*45, PMNAM2*45 ! Part. method desc.

Referenced by w3grid().

◆ pmove

real w3gridmd::pmove

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ pname

character w3gridmd::pname

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ pname2

character w3gridmd::pname2

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ pnsmc

character w3gridmd::pnsmc

Definition at line 907 of file w3gridmd.F90.

907  CHARACTER :: PNSMC*30

Referenced by w3grid().

◆ polatac

real w3gridmd::polatac

Definition at line 687 of file w3gridmd.F90.

Referenced by w3grid().

◆ polonac

real w3gridmd::polonac

Definition at line 687 of file w3gridmd.F90.

687  REAL :: PoLonAC, PoLatAC

Referenced by w3grid().

◆ ptfc

real w3gridmd::ptfc

Definition at line 813 of file w3gridmd.F90.

813  REAL :: PTFC ! Part. cut off freq (for method 5)

Referenced by w3grid().

◆ ptm

integer w3gridmd::ptm

Definition at line 812 of file w3gridmd.F90.

812  INTEGER :: PTM ! Partitioning method

Referenced by w3grid().

◆ qparms

real, dimension(500) w3gridmd::qparms

Definition at line 669 of file w3gridmd.F90.

669  REAL :: QPARMS(500)

Referenced by w3grid().

◆ rd

real, dimension(4) w3gridmd::rd

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ rdtot

real w3gridmd::rdtot

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ readmp

integer, dimension(:,:), allocatable w3gridmd::readmp

Definition at line 625 of file w3gridmd.F90.

Referenced by w3grid().

◆ refcoast

real w3gridmd::refcoast

Definition at line 739 of file w3gridmd.F90.

739  REAL :: REFCOAST, REFFREQ, REFMAP, &
740  REFSUBGRID, REFRMAX, REFMAPD, &
741  REFICEBERG, REFCOSP_STRAIGHT, &
742  REFFREQPOW, REFUNSTSOURCE

Referenced by w3grid().

◆ refcosp_straight

real w3gridmd::refcosp_straight

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refd

real, dimension(:,:), allocatable w3gridmd::refd

Definition at line 704 of file w3gridmd.F90.

704  REAL, ALLOCATABLE :: REFD(:,:), REFD2(:,:), REFS(:,:)

Referenced by w3grid().

◆ refd2

real, dimension(:,:), allocatable w3gridmd::refd2

Definition at line 704 of file w3gridmd.F90.

Referenced by w3grid().

◆ reffreq

real w3gridmd::reffreq

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ reffreqpow

real w3gridmd::reffreqpow

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ reficeberg

real w3gridmd::reficeberg

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refmap

real w3gridmd::refmap

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refmapd

real w3gridmd::refmapd

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refrmax

real w3gridmd::refrmax

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refs

real, dimension(:,:), allocatable w3gridmd::refs

Definition at line 704 of file w3gridmd.F90.

Referenced by w3grid().

◆ refslope

real w3gridmd::refslope

Definition at line 723 of file w3gridmd.F90.

Referenced by w3grid().

◆ refsubgrid

real w3gridmd::refsubgrid

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ refunstsource

real w3gridmd::refunstsource

Definition at line 739 of file w3gridmd.F90.

Referenced by w3grid().

◆ rfhf

real w3gridmd::rfhf

Definition at line 654 of file w3gridmd.F90.

Referenced by w3grid().

◆ rfmaxd

real w3gridmd::rfmaxd

Definition at line 905 of file w3gridmd.F90.

Referenced by w3grid().

◆ rform

character w3gridmd::rform

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ rfpm

real w3gridmd::rfpm

Definition at line 654 of file w3gridmd.F90.

Referenced by w3grid().

◆ rfr1

real w3gridmd::rfr1

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ ripfac1

real w3gridmd::ripfac1

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ ripfac2

real w3gridmd::ripfac2

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ ripfac3

real w3gridmd::ripfac3

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ ripfac4

real w3gridmd::ripfac4

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ rth0

real w3gridmd::rth0

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ rwndc

real w3gridmd::rwndc

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ rxfr

real w3gridmd::rxfr

Definition at line 630 of file w3gridmd.F90.

630  REAL :: RXFR, RFR1, SIGMA, SXFR, FACHF, &
631  VSC, VSC0, VOF, &
632  ZLIM, X, Y, XP, XO0, YO0, DXO, DYO, &
633  XO, YO, RD(4), RDTOT, &
634  FACTOR, RTH0, FMICHE, RWNDC, &
635  WCOR1, WCOR2

Referenced by w3grid().

◆ sdkof

real w3gridmd::sdkof

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sds4a

real w3gridmd::sds4a

Definition at line 849 of file w3gridmd.F90.

◆ sdsa0

real w3gridmd::sdsa0

Definition at line 834 of file w3gridmd.F90.

834  REAL :: SDSA0, SDSA1, SDSA2, &
835  SDSB0, SDSB1, SDSB2, SDSB3

Referenced by w3grid().

◆ sdsa1

real w3gridmd::sdsa1

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsa2

real w3gridmd::sdsa2

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsabk

real w3gridmd::sdsabk

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsb0

real w3gridmd::sdsb0

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsb1

real w3gridmd::sdsb1

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsb2

real w3gridmd::sdsb2

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsb3

real w3gridmd::sdsb3

Definition at line 834 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbchoice

real w3gridmd::sdsbchoice

Definition at line 848 of file w3gridmd.F90.

848  REAL :: SDSBCHOICE

Referenced by w3grid().

◆ sdsbck

real w3gridmd::sdsbck

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbint

real w3gridmd::sdsbint

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbm0

real w3gridmd::sdsbm0

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbm1

real w3gridmd::sdsbm1

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbm2

real w3gridmd::sdsbm2

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbm3

real w3gridmd::sdsbm3

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbm4

real w3gridmd::sdsbm4

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbr

real w3gridmd::sdsbr

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbrf1

real w3gridmd::sdsbrf1

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbrfdf

integer w3gridmd::sdsbrfdf

Definition at line 846 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsbt

real w3gridmd::sdsbt

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsc1

real w3gridmd::sdsc1

Definition at line 841 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsc2

real w3gridmd::sdsc2

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsc4

real w3gridmd::sdsc4

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsc5

real w3gridmd::sdsc5

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsc6

real w3gridmd::sdsc6

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdscos

real w3gridmd::sdscos

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdscum

real w3gridmd::sdscum

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdscump

real w3gridmd::sdscump

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsdelta1

real w3gridmd::sdsdelta1

Definition at line 841 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsdelta2

real w3gridmd::sdsdelta2

Definition at line 841 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsdth

real w3gridmd::sdsdth

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdset

logical w3gridmd::sdset

Definition at line 872 of file w3gridmd.F90.

872  LOGICAL :: SDSET, CSTB1

Referenced by w3grid().

◆ sdsfacmtf

real w3gridmd::sdsfacmtf

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdshck

real w3gridmd::sdshck

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsiso

integer w3gridmd::sdsiso

Definition at line 846 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsl

real w3gridmd::sdsl

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsmwd

real w3gridmd::sdsmwd

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsmwpow

real w3gridmd::sdsmwpow

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsnmtf

real w3gridmd::sdsnmtf

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsnuw

real w3gridmd::sdsnuw

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsp

real w3gridmd::sdsp

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsp1

integer w3gridmd::sdsp1

Definition at line 871 of file w3gridmd.F90.

871  INTEGER :: SDSP1, SDSP2

Referenced by w3grid().

◆ sdsp2

integer w3gridmd::sdsp2

Definition at line 871 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdspbk

real w3gridmd::sdspbk

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsstrain

real w3gridmd::sdsstrain

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsstrain2

real w3gridmd::sdsstrain2

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sdsstraina

real w3gridmd::sdsstraina

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ seawnd

logical w3gridmd::seawnd

Definition at line 906 of file w3gridmd.F90.

Referenced by w3grid().

◆ sed_d50_uniform

real w3gridmd::sed_d50_uniform

Definition at line 708 of file w3gridmd.F90.

708  REAL :: SED_D50_UNIFORM, SED_DSTAR, RIPFAC1, &
709  RIPFAC2, RIPFAC3, RIPFAC4, SIGDEPTH, &
710  BOTROUGHMIN, BOTROUGHFAC

Referenced by w3grid().

◆ sed_d50file

real, dimension(:,:), allocatable w3gridmd::sed_d50file

Definition at line 706 of file w3gridmd.F90.

706  REAL, ALLOCATABLE :: SED_D50FILE(:,:), SED_POROFILE(:,:)

Referenced by w3grid().

◆ sed_dstar

real w3gridmd::sed_dstar

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ sed_porofile

real, dimension(:,:), allocatable w3gridmd::sed_porofile

Definition at line 706 of file w3gridmd.F90.

◆ sedmapd50

logical w3gridmd::sedmapd50

Definition at line 707 of file w3gridmd.F90.

707  LOGICAL :: SEDMAPD50

Referenced by w3grid().

◆ setup_apply_wlv

logical w3gridmd::setup_apply_wlv

Definition at line 932 of file w3gridmd.F90.

932  LOGICAL :: SETUP_APPLY_WLV

Referenced by w3grid().

◆ sigdepth

real w3gridmd::sigdepth

Definition at line 708 of file w3gridmd.F90.

Referenced by w3grid().

◆ sigma

real w3gridmd::sigma

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ sigmaucap

real w3gridmd::sigmaucap

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sina0

real w3gridmd::sina0

Definition at line 869 of file w3gridmd.F90.

869  REAL :: SINA0, SINWS, SINFC, &
870  SDSA1, SDSA2, SWLB1

Referenced by w3grid().

◆ sinbr

real w3gridmd::sinbr

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sinfc

real w3gridmd::sinfc

Definition at line 869 of file w3gridmd.F90.

Referenced by w3grid().

◆ sintable

integer w3gridmd::sintable

Definition at line 846 of file w3gridmd.F90.

Referenced by w3grid().

◆ sintail1

real w3gridmd::sintail1

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sintail2

real w3gridmd::sintail2

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ sinthp

real w3gridmd::sinthp

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ sinws

real w3gridmd::sinws

Definition at line 869 of file w3gridmd.F90.

Referenced by w3grid().

◆ snlcs1

real w3gridmd::snlcs1

Definition at line 876 of file w3gridmd.F90.

Referenced by w3grid().

◆ snlcs2

real w3gridmd::snlcs2

Definition at line 876 of file w3gridmd.F90.

Referenced by w3grid().

◆ snlcs3

real w3gridmd::snlcs3

Definition at line 876 of file w3gridmd.F90.

Referenced by w3grid().

◆ solverthr_setup

real*8 w3gridmd::solverthr_setup

Definition at line 941 of file w3gridmd.F90.

941  real*8 :: solverthr_setup

Referenced by w3grid().

◆ spmss

real w3gridmd::spmss

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ stabof

real w3gridmd::stabof

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ stabsh

real w3gridmd::stabsh

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ status

character w3gridmd::status

Definition at line 782 of file w3gridmd.F90.

Referenced by readnl(), and w3grid().

◆ stdlat

real, dimension(:,:), allocatable w3gridmd::stdlat

Definition at line 694 of file w3gridmd.F90.

Referenced by w3grid().

◆ stdlon

real, dimension(:,:), allocatable w3gridmd::stdlon

Definition at line 694 of file w3gridmd.F90.

Referenced by w3grid().

◆ stdt

real w3gridmd::stdt

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ stdx

real w3gridmd::stdx

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ stdy

real w3gridmd::stdy

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ sth1mf

integer w3gridmd::sth1mf

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ sth2mf

integer w3gridmd::sth2mf

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ stk_wn

real, dimension(25) w3gridmd::stk_wn

Definition at line 650 of file w3gridmd.F90.

650  REAL :: STK_WN(25)

Referenced by w3grid().

◆ stxftf

real w3gridmd::stxftf

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ stxftftail

real w3gridmd::stxftftail

Definition at line 841 of file w3gridmd.F90.

841  REAL :: STXFTFTAIL, SDSC1, &
842  SDSDELTA1, SDSDELTA2

Referenced by w3grid().

◆ stxftwn

real w3gridmd::stxftwn

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf

real w3gridmd::swellf

Definition at line 832 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf2

real w3gridmd::swellf2

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf3

real w3gridmd::swellf3

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf4

real w3gridmd::swellf4

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf5

real w3gridmd::swellf5

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf6

real w3gridmd::swellf6

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellf7

real w3gridmd::swellf7

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ swellfpar

integer w3gridmd::swellfpar

Definition at line 846 of file w3gridmd.F90.

846  INTEGER :: SWELLFPAR, SDSISO, SDSBRFDF, SINTABLE,&
847  TAUWBUG

Referenced by w3grid().

◆ swlb1

real w3gridmd::swlb1

Definition at line 869 of file w3gridmd.F90.

Referenced by w3grid().

◆ sxfr

real w3gridmd::sxfr

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ symr

real w3gridmd::symr

Definition at line 905 of file w3gridmd.F90.

Referenced by w3grid().

◆ taillev

real w3gridmd::taillev

Definition at line 818 of file w3gridmd.F90.

818  REAL :: TAILLEV, TAILT1, TAILT2

Referenced by w3grid().

◆ tailnl

real w3gridmd::tailnl

Definition at line 879 of file w3gridmd.F90.

879  REAL :: TAILNL, GQMTHRSAT, GQMTHRCOU, GQAMP1, GQAMP2, GQAMP3, GQAMP4

Referenced by w3grid().

◆ tailt1

real w3gridmd::tailt1

Definition at line 818 of file w3gridmd.F90.

Referenced by w3grid().

◆ tailt2

real w3gridmd::tailt2

Definition at line 818 of file w3gridmd.F90.

Referenced by w3grid().

◆ tailtype

integer w3gridmd::tailtype

Definition at line 817 of file w3gridmd.F90.

817  INTEGER :: TAILTYPE

Referenced by w3grid().

◆ tauwbug

integer w3gridmd::tauwbug

Definition at line 846 of file w3gridmd.F90.

Referenced by w3grid().

◆ tauwshelter

real w3gridmd::tauwshelter

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ th1mf

integer w3gridmd::th1mf

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ th2mf

integer w3gridmd::th2mf

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ tmpmap

integer, dimension(:,:), allocatable w3gridmd::tmpmap

Definition at line 625 of file w3gridmd.F90.

Referenced by w3grid().

◆ tmpsta

integer, dimension(:,:), allocatable w3gridmd::tmpsta

Definition at line 625 of file w3gridmd.F90.

625  INTEGER, ALLOCATABLE :: TMPSTA(:,:), TMPMAP(:,:), READMP(:,:)

Referenced by w3grid().

◆ tname

character w3gridmd::tname

Definition at line 782 of file w3gridmd.F90.

Referenced by w3grid().

◆ trckcmpr

logical w3gridmd::trckcmpr

Definition at line 811 of file w3gridmd.F90.

Referenced by w3grid().

◆ trnmx

real w3gridmd::trnmx

Definition at line 683 of file w3gridmd.F90.

683  REAL :: TRNMX, TRNMY

Referenced by w3grid().

◆ trnmy

real w3gridmd::trnmy

Definition at line 683 of file w3gridmd.F90.

Referenced by w3grid().

◆ typeid

character(len=18) w3gridmd::typeid

Definition at line 787 of file w3gridmd.F90.

787  CHARACTER(LEN=18) :: TYPEID

Referenced by w3grid().

◆ ucap

real w3gridmd::ucap

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ ugbccfl

logical w3gridmd::ugbccfl

Definition at line 922 of file w3gridmd.F90.

922  LOGICAL :: UGBCCFL

Referenced by w3grid().

◆ ugobcauto

logical w3gridmd::ugobcauto

Definition at line 921 of file w3gridmd.F90.

921  LOGICAL :: UGOBCAUTO

Referenced by w3grid().

◆ ugobcdepth

real w3gridmd::ugobcdepth

Definition at line 945 of file w3gridmd.F90.

945  REAL :: UGOBCDEPTH

Referenced by w3grid().

◆ ugobcfile

character w3gridmd::ugobcfile

Definition at line 944 of file w3gridmd.F90.

944  CHARACTER :: UGOBCFILE*60

Referenced by w3grid().

◆ ugobcok

logical w3gridmd::ugobcok

Definition at line 946 of file w3gridmd.F90.

946  LOGICAL :: UGOBCOK

Referenced by w3grid().

◆ uno3

logical w3gridmd::uno3

Definition at line 906 of file w3gridmd.F90.

906  LOGICAL :: UNO3, AVERG, SEAWND, Arctic

Referenced by w3grid().

◆ unrot

logical w3gridmd::unrot

Definition at line 950 of file w3gridmd.F90.

950  LOGICAL :: UNROT

Referenced by w3grid().

◆ unstscheme

integer w3gridmd::unstscheme

Definition at line 936 of file w3gridmd.F90.

936  INTEGER :: UNSTSCHEME

Referenced by w3grid().

◆ unstschemes

integer, dimension(6) w3gridmd::unstschemes

Definition at line 935 of file w3gridmd.F90.

935  INTEGER :: UNSTSCHEMES(6)

Referenced by w3grid().

◆ us3d

integer w3gridmd::us3d

Definition at line 643 of file w3gridmd.F90.

643  INTEGER :: US3D,I1US3D,I2US3D, &
644  USSP, IUSSP, &
645  TH1MF, I1TH1M, I2TH1M, &
646  STH1MF, I1STH1M, I2STH1M, &
647  TH2MF, I1TH2M, I2TH2M, &
648  STH2MF, I1STH2M, I2STH2M

Referenced by w3grid().

◆ usecgice

logical w3gridmd::usecgice

Definition at line 765 of file w3gridmd.F90.

Referenced by w3grid().

◆ ussp

integer w3gridmd::ussp

Definition at line 643 of file w3gridmd.F90.

Referenced by w3grid().

◆ viscstress

real w3gridmd::viscstress

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ vof

real w3gridmd::vof

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ vsc

real w3gridmd::vsc

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ vsc0

real w3gridmd::vsc0

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ wcor1

real w3gridmd::wcor1

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ wcor2

real w3gridmd::wcor2

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ wdthcg

real w3gridmd::wdthcg

Definition at line 911 of file w3gridmd.F90.

911  REAL :: WDTHCG, WDTHTH

Referenced by w3grid().

◆ wdthth

real w3gridmd::wdthth

Definition at line 911 of file w3gridmd.F90.

Referenced by w3grid().

◆ whitecapdur

real w3gridmd::whitecapdur

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ whitecapwidth

real w3gridmd::whitecapwidth

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ wnmeanp

real w3gridmd::wnmeanp

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ wnmeanptail

real w3gridmd::wnmeanptail

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ wsc

real w3gridmd::wsc

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ wsm

real w3gridmd::wsm

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ x

real w3gridmd::x

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ xfilt

real w3gridmd::xfilt

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ xgrdin

real, dimension(:,:), allocatable w3gridmd::xgrdin

Definition at line 702 of file w3gridmd.F90.

702  REAL, ALLOCATABLE :: XGRDIN(:,:), YGRDIN(:,:)

Referenced by w3grid().

◆ xlonac

real, dimension(:), allocatable w3gridmd::xlonac

Definition at line 690 of file w3gridmd.F90.

690  REAL, ALLOCATABLE :: XLONAC(:),YLATAC(:),ELONAC(:),ELATAC(:)

Referenced by w3grid().

◆ xo

real w3gridmd::xo

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ xo0

real w3gridmd::xo0

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ xp

real w3gridmd::xp

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ xr

real w3gridmd::xr

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ xseed

real w3gridmd::xseed

Definition at line 804 of file w3gridmd.F90.

Referenced by w3grid().

◆ y

real w3gridmd::y

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ yesxno

character(len=6), dimension(2) w3gridmd::yesxno

Definition at line 785 of file w3gridmd.F90.

785  CHARACTER(LEN=6) :: YESXNO(2)

Referenced by w3grid().

◆ ygrdin

real, dimension(:,:), allocatable w3gridmd::ygrdin

Definition at line 702 of file w3gridmd.F90.

Referenced by w3grid().

◆ yj0r

real w3gridmd::yj0r

Definition at line 905 of file w3gridmd.F90.

Referenced by w3grid().

◆ ylatac

real, dimension(:), allocatable w3gridmd::ylatac

Definition at line 690 of file w3gridmd.F90.

Referenced by w3grid().

◆ yo

real w3gridmd::yo

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ yo0

real w3gridmd::yo0

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ z0max

real w3gridmd::z0max

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ z0rat

real w3gridmd::z0rat

Definition at line 849 of file w3gridmd.F90.

Referenced by w3grid().

◆ zalp

real w3gridmd::zalp

Definition at line 838 of file w3gridmd.F90.

Referenced by w3grid().

◆ zbin

real, dimension(:,:), allocatable w3gridmd::zbin

Definition at line 703 of file w3gridmd.F90.

703  REAL, ALLOCATABLE :: ZBIN(:,:), OBSX(:,:), OBSY(:,:)

Referenced by w3grid().

◆ zlim

real w3gridmd::zlim

Definition at line 630 of file w3gridmd.F90.

Referenced by w3grid().

◆ zwnd

real w3gridmd::zwnd

Definition at line 832 of file w3gridmd.F90.

832  REAL :: ZWND, SWELLF, STABSH, STABOF, &
833  CNEG, CPOS, FNEG, FPOS

Referenced by w3grid().

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
scrip_grids::grid1_corners
integer(scrip_i4), save grid1_corners
Definition: scrip_grids.f:68
scrip_grids::grid1_mask
logical(scrip_logical), dimension(:), allocatable, target, save grid1_mask
Definition: scrip_grids.f:93
w3snlsmd::abmax
real, parameter abmax
Definition: w3snlsmd.F90:101
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3gdatmd::ungtype
integer, parameter ungtype
Definition: w3gdatmd.F90:626
w3gdatmd::mapth
integer, dimension(:), pointer mapth
Definition: w3gdatmd.F90:1231
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3gdatmd::ecos
real, dimension(:), pointer ecos
Definition: w3gdatmd.F90:1234
m_constants::rade
real rade
conversion from radians to degrees
Definition: mod_constants.f90:33
w3gdatmd::dsip
real, dimension(:), pointer dsip
Definition: w3gdatmd.F90:1234
scrip_grids::grid1_rank
integer(scrip_i4), save grid1_rank
Definition: scrip_grids.f:68
w3gdatmd::th
real, dimension(:), pointer th
Definition: w3gdatmd.F90:1234
scrip_timers::status
character(len=8), dimension(max_timers), save status
Definition: scrip_timers.f:63
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
m_constants::grav
real grav
gravitational acceleration
Definition: mod_constants.f90:19
w3gdatmd::esin
real, dimension(:), pointer esin
Definition: w3gdatmd.F90:1234
scrip_grids::grid1_dims
integer(scrip_i4), dimension(:), allocatable, save grid1_dims
Definition: scrip_grids.f:74
w3timemd::caltype
character, public caltype
Definition: w3timemd.F90:79
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
scrip_grids::grid1_center_lon
real(scrip_r8), dimension(:), allocatable, target, save grid1_center_lon
Definition: scrip_grids.f:103
scrip_grids::grid1_corner_lat
real(scrip_r8), dimension(:,:), allocatable, target, save grid1_corner_lat
Definition: scrip_grids.f:120
scrip_grids::grid1_name
character(scrip_charlength), save grid1_name
Definition: scrip_grids.f:77
m_constants::pi
real pi
circular constant, 3.1415...
Definition: mod_constants.f90:29
w3snl3md::delthm
real, parameter, public delthm
Definition: w3snl3md.F90:132
w3dispmd::distab
subroutine distab
Definition: w3dispmd.F90:552
file
file(STRINGS ${CMAKE_BINARY_DIR}/switch switch_strings) separate_arguments(switches UNIX_COMMAND $
Definition: CMakeLists.txt:3
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::gtype
integer, pointer gtype
Definition: w3gdatmd.F90:1094
w3gdatmd::mapwn
integer, dimension(:), pointer mapwn
Definition: w3gdatmd.F90:1231
scrip_grids::grid1_center_lat
real(scrip_r8), dimension(:), allocatable, target, save grid1_center_lat
Definition: scrip_grids.f:103
w3snl3md::lammax
real, parameter, public lammax
Definition: w3snl3md.F90:131
scrip_grids::grid1_corner_lon
real(scrip_r8), dimension(:,:), allocatable, target, save grid1_corner_lon
Definition: scrip_grids.f:120
m_constants::dera
real dera
conversion from degrees to radians
Definition: mod_constants.f90:32
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
scrip_grids::grid1_size
integer(scrip_i4), save grid1_size
Definition: scrip_grids.f:68
w3gdatmd::igpars
real, dimension(:), pointer igpars
Definition: w3gdatmd.F90:1142
constants::file_endian
character(*), parameter file_endian
FILE_ENDIAN Filled by preprocessor with 'big_endian', 'little_endian', or 'native'.
Definition: constants.F90:86
w3gdatmd::ec2
real, dimension(:), pointer ec2
Definition: w3gdatmd.F90:1234
scrip_grids::grid1_imask
integer(scrip_i4), dimension(:), allocatable, target, save grid1_imask
Definition: scrip_grids.f:99
scrip_grids::grid1_units
character(scrip_charlength), save grid1_units
Definition: scrip_grids.f:80