WAVEWATCH III  beta 0.0.1
pdlib_w3profsmd Module Reference

Functions/Subroutines

subroutine pdlib_init (IMOD)
 
subroutine pdlib_mapsta_init (IMOD)
 
subroutine pdlib_iobp_init (IMOD)
 
subroutine pdlib_w3xypug (ISP, FACX, FACY, DTG, VGX, VGY, LCALC)
 
subroutine pdlib_w3xypfsn2 (ISP, C, LCALC, RD10, RD20, DT, AC)
 
subroutine pdlib_w3xypfspsi2 (ISP, C, LCALC, RD10, RD20, DT, AC)
 
subroutine pdlib_w3xypfsfct2 (ISP, C, LCALC, RD10, RD20, DT, AC)
 
subroutine test_mpi_status (string)
 
subroutine scal_integral_print_general (V, string, maxidx, CheckUncovered, PrintFullValue)
 
subroutine scal_integral_print_r8 (V, string)
 
subroutine scal_integral_print_r4 (V, string)
 
subroutine all_vaold_integral_print (string, choice)
 
subroutine all_va_integral_print (IMOD, string, choice)
 
subroutine all_field_integral_print (FIELD, string)
 
subroutine check_array_integral_nx_r8_maxfunct (TheARR, string, maxidx, PrintMinISP, LocalizeMaximum)
 
subroutine check_array_integral_nx_r8 (TheARR, string, maxidx)
 
subroutine pdlib_w3xypug_block_implicit (IMOD, FACX, FACY, DTG, VGX, VGY, LCALC)
 
subroutine pdlib_w3xypug_block_explicit (IMOD, FACX, FACY, DTG, VGX, VGY, LCALC)
 
subroutine print_wn_statistic (string)
 
subroutine write_var_to_text_file (TheArr, eFile)
 
subroutine printtotaloffcontrib (string)
 
subroutine compute_mean_param (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX)
 
subroutine calcarray_jacobi (DTG, FACX, FACY, VGX, VGY)
 
subroutine calcarray_jacobi_vec (DTG, FACX, FACY, VGX, VGY)
 
subroutine calcarray_jacobi2 (DTG, FACX, FACY, VGX, VGY)
 
subroutine calcarray_jacobi3 (IP, J, DTG, FACX, FACY, VGX, VGY, ASPAR_DIAG_LOCAL, ASPAR_OFF_DIAG_LOCAL, B_JAC_LOCAL)
 
subroutine calcarray_jacobi4 (IP, DTG, FACX, FACY, VGX, VGY, ASPAR_DIAG_LOCAL, ASPAR_OFF_DIAG_LOCAL, B_JAC_LOCAL)
 
subroutine calcarray_jacobi_spectral_1 (DTG)
 
subroutine calcarray_jacobi_spectral_2 (DTG, ASPAR_DIAG_LOCAL)
 
subroutine calcarray_jacobi_source_1 (DTG)
 
subroutine calcarray_jacobi_source_2 (DTG, ASPAR_DIAG_LOCAL)
 
subroutine apply_boundary_condition_va
 
subroutine apply_boundary_condition (IMOD)
 
subroutine action_limiter_local (IP, ACLOC, ACOLD, DTG)
 
subroutine pdlib_jacobi_gauss_seidel_block (IMOD, FACX, FACY, DTG, VGX, VGY, LCALC)
 
subroutine pdlib_explicit_block (IMOD, FACX, FACY, DTG, VGX, VGY, LCALC)
 
subroutine block_solver_explicit_init ()
 
subroutine block_solver_init (IMOD)
 
subroutine set_iobdp_pdlib
 
subroutine set_iobpa_pdlib
 
subroutine set_ug_iobp_pdlib_init ()
 
subroutine block_solver_finalize
 
subroutine deallocate_pdlib_global (IMOD)
 
subroutine ergout (FHNDL, ERGNAME)
 
subroutine jacobi_init (IMOD)
 
subroutine jacobi_finalize
 

Variables

integer, save ient = 0
 
logical mapsta_hack = .FALSE.
 
real, dimension(:,:), allocatable aspar_jac
 
real, dimension(:,:), allocatable aspar_diag_sources
 
real, dimension(:,:), allocatable aspar_diag_all
 
real, dimension(:,:), allocatable b_jac
 
real, dimension(:,:), allocatable cad_the
 
real, dimension(:,:), allocatable cas_sig
 
real, dimension(:,:), allocatable cwnb_sig_m2
 
real, dimension(:,:), allocatable u_jac
 
real, dimension(:), allocatable cofrm4
 
real *8, dimension(:,:,:), allocatable flall1
 
real *8, dimension(:,:,:), allocatable kelem1
 
real *8, dimension(:,:,:), allocatable flall2
 
real *8, dimension(:,:,:), allocatable kelem2
 
real *8, dimension(:,:,:), allocatable flall3
 
real *8, dimension(:,:,:), allocatable kelem3
 
real *8, dimension(:,:,:), allocatable nm
 
real *8, dimension(:), allocatable dtsi
 
integer, dimension(:), allocatable iter
 
integer, dimension(:), allocatable is0_pdlib
 
integer freqshiftmethod = 2
 
logical fsgeoadvect
 
logical, save linit_output = .TRUE.
 
real, save rtime = 0.d0
 
integer, dimension(3, 2) pos_trick
 
integer testnode = 1
 
integer memunit
 

Function/Subroutine Documentation

◆ action_limiter_local()

subroutine pdlib_w3profsmd::action_limiter_local ( integer, intent(in)  IP,
real, dimension(nspec), intent(inout)  ACLOC,
real, dimension(nspec), intent(in)  ACOLD,
real, intent(in)  DTG 
)

Definition at line 5321 of file w3profsmd_pdlib.F90.

5321  !/
5322  !/ +-----------------------------------+
5323  !/ | WAVEWATCH III NOAA/NCEP |
5324  !/ | |
5325  !/ | Aron Roland (BGS IT&E GmbH) |
5326  !/ | Mathieu Dutour-Sikiric (IRB) |
5327  !/ | |
5328  !/ | FORTRAN 90 |
5329  !/ | Last update : 01-June-2018 |
5330  !/ +-----------------------------------+
5331  !/
5332  !/ 01-June-2018 : Origination. ( version 6.04 )
5333  !/
5334  ! 1. Purpose : Computation of the limiter function
5335  ! 2. Method :
5336  ! 3. Parameters :
5337  !
5338  ! Parameter list
5339  ! ----------------------------------------------------------------
5340  ! ----------------------------------------------------------------
5341  !
5342  ! 4. Subroutines used :
5343  !
5344  ! Name Type Module Description
5345  ! ----------------------------------------------------------------
5346  ! STRACE Subr. W3SERVMD Subroutine tracing.
5347  ! ----------------------------------------------------------------
5348  !
5349  ! 5. Called by :
5350  !
5351  ! Name Type Module Description
5352  ! ----------------------------------------------------------------
5353  ! ----------------------------------------------------------------
5354  !
5355  ! 6. Error messages :
5356  ! 7. Remarks
5357  ! 8. Structure :
5358  ! 9. Switches :
5359  !
5360  ! !/S Enable subroutine tracing.
5361  !
5362  ! 10. Source code :
5363  !
5364  !/ ------------------------------------------------------------------- /
5365 #ifdef W3_S
5366  USE w3servmd, only: strace
5367 #endif
5368  use yownodepool, only: iplg
5369  USE constants, only : grav, tpi
5370  USE w3adatmd, only : wn, cg
5371  USE w3gdatmd, only : nth, nk, nspec, mapfs, sig, facp
5372  !/
5373  !/
5374  !/ ------------------------------------------------------------------- /
5375  !/ Parameter list
5376  !/
5377  !/ ------------------------------------------------------------------- /
5378  !/ Local PARAMETERs
5379  !/
5380 #ifdef W3_S
5381  INTEGER, SAVE :: IENT = 0
5382 #endif
5383  !/
5384  !/ ------------------------------------------------------------------- /
5385  !/
5386  INTEGER, INTENT(in) :: IP
5387  REAL, INTENT(in) :: ACOLD(NSPEC)
5388  REAL, INTENT(inout) :: ACLOC(NSPEC)
5389  REAL, INTENT(in) :: DTG
5390  INTEGER :: MELIM = 1
5391  REAL :: LIMFAK = 0.1
5392  REAL :: CONST, SND, eWN, eWK, eWKpow
5393  REAL :: eFact, eSPSIG
5394  REAL :: NewVAL
5395  REAL :: OLDAC, NEWAC, NEWDAC
5396  REAL :: MAXDAC
5397  REAL :: dac, limac, eDam
5398  INTEGER IP_glob, ISEA
5399  INTEGER :: IK, ITH, ISP
5400  LOGICAL :: LLIMITER_WWM
5401 #ifdef W3_S
5402  CALL strace (ient, 'ACTION_LIMITER_LOCAL')!
5403 #endif
5404  ip_glob=iplg(ip)
5405  isea=mapfs(1,ip_glob)
5406  espsig=sig(nk)
5407  const = tpi**2*3.0*1.0e-7*dtg*espsig
5408  snd = tpi*5.6*1.0e-3
5409 
5410  llimiter_wwm = .false.
5411 
5412  IF (llimiter_wwm) THEN
5413  maxdac = 0
5414  DO ik=1,nk
5415  IF (melim .eq. 1) THEN
5416  efact=2.*sig(ik)
5417  ewn=wn(ik,isea)
5418  ewk=ewn
5419  ewkpow=ewk**3
5420  maxdac = dble(0.0081*limfak/(efact*ewkpow*cg(ik,isea)))
5421  END IF
5422  DO ith=1,nth
5423  isp=ith + (ik-1)*nth
5424  newac = acloc(isp)
5425  oldac = acold(isp)
5426  newdac = newac - oldac
5427  newdac = sign(min(maxdac,abs(newdac)), newdac)
5428  newval = max(0., oldac + newdac )
5429  acloc(isp) = newval
5430  END DO
5431  END DO
5432  ELSE
5433  DO ik = 1, nk
5434  edam=dble(facp / (sig(ik) * wn(ik,isea)**3))
5435  DO ith=1,nth
5436  isp = ith + (ik-1)*nth
5437  dac = acloc(isp) - acold(isp)
5438  limac = sign(min(edam,abs(dac)),dac)
5439  acloc(isp) = max(0., acloc(isp) + limac)
5440  END DO
5441  END DO
5442  ENDIF

References w3adatmd::cg, w3gdatmd::facp, constants::grav, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::sig, w3servmd::strace(), constants::tpi, and w3adatmd::wn.

◆ all_field_integral_print()

subroutine pdlib_w3profsmd::all_field_integral_print ( real, dimension(nspec,nseal), intent(in)  FIELD,
character(*), intent(in)  string 
)

Definition at line 2387 of file w3profsmd_pdlib.F90.

2387  !/
2388  !/ +-----------------------------------+
2389  !/ | WAVEWATCH III NOAA/NCEP |
2390  !/ | |
2391  !/ | Aron Roland (BGS IT&E GmbH) |
2392  !/ | Mathieu Dutour-Sikiric (IRB) |
2393  !/ | |
2394  !/ | FORTRAN 90 |
2395  !/ | Last update : 01-June-2018 |
2396  !/ +-----------------------------------+
2397  !/
2398  !/ 01-June-2018 : Origination. ( version 6.04 )
2399  !/
2400  ! 1. Purpose : Source code for parallel debugging
2401  ! 2. Method :
2402  ! 3. Parameters :
2403  !
2404  ! Parameter list
2405  ! ----------------------------------------------------------------
2406  ! ----------------------------------------------------------------
2407  !
2408  ! 4. Subroutines used :
2409  !
2410  ! Name Type Module Description
2411  ! ----------------------------------------------------------------
2412  ! STRACE Subr. W3SERVMD Subroutine tracing.
2413  ! ----------------------------------------------------------------
2414  !
2415  ! 5. Called by :
2416  !
2417  ! Name Type Module Description
2418  ! ----------------------------------------------------------------
2419  ! ----------------------------------------------------------------
2420  !
2421  ! 6. Error messages :
2422  ! 7. Remarks
2423  ! 8. Structure :
2424  ! 9. Switches :
2425  !
2426  ! !/S Enable subroutine tracing.
2427  !
2428  ! 10. Source code :
2429  !
2430  !/ ------------------------------------------------------------------- /
2431 
2432  USE w3gdatmd, only : nseal
2433  USE w3wdatmd, only : va
2434  USE w3odatmd, only : iaproc
2435  USE w3gdatmd, only : nspec
2436 
2437  INTEGER maxidx
2438  REAL, INTENT(in) :: FIELD(NSPEC,NSEAL)
2439  CHARACTER(*), INTENT(in) :: string
2440  LOGICAL :: PrintMinISP = .false.
2441  LOGICAL :: LocalizeMaximum = .false.
2442  maxidx = nseal
2443  CALL check_array_integral_nx_r8_maxfunct(field, string, maxidx, printminisp, localizemaximum)

References check_array_integral_nx_r8_maxfunct(), w3odatmd::iaproc, w3gdatmd::nseal, w3gdatmd::nspec, and w3wdatmd::va.

Referenced by w3wavemd::w3wave().

◆ all_va_integral_print()

subroutine pdlib_w3profsmd::all_va_integral_print ( integer, intent(in)  IMOD,
character(*), intent(in)  string,
integer, intent(in)  choice 
)

Definition at line 2292 of file w3profsmd_pdlib.F90.

2292  !/
2293  !/ +-----------------------------------+
2294  !/ | WAVEWATCH III NOAA/NCEP |
2295  !/ | |
2296  !/ | Aron Roland (BGS IT&E GmbH) |
2297  !/ | Mathieu Dutour-Sikiric (IRB) |
2298  !/ | |
2299  !/ | FORTRAN 90 |
2300  !/ | Last update : 01-June-2018 |
2301  !/ +-----------------------------------+
2302  !/
2303  !/ 01-June-2018 : Origination. ( version 6.04 )
2304  !/
2305  ! 1. Purpose : Source code for parallel debugging
2306  ! 2. Method :
2307  ! 3. Parameters :
2308  !
2309  ! Parameter list
2310  ! ----------------------------------------------------------------
2311  ! ----------------------------------------------------------------
2312  !
2313  ! 4. Subroutines used :
2314  !
2315  ! Name Type Module Description
2316  ! ----------------------------------------------------------------
2317  ! STRACE Subr. W3SERVMD Subroutine tracing.
2318  ! ----------------------------------------------------------------
2319  !
2320  ! 5. Called by :
2321  !
2322  ! Name Type Module Description
2323  ! ----------------------------------------------------------------
2324  ! ----------------------------------------------------------------
2325  !
2326  ! 6. Error messages :
2327  ! 7. Remarks
2328  ! 8. Structure :
2329  ! 9. Switches :
2330  !
2331  ! !/S Enable subroutine tracing.
2332  !
2333  ! 10. Source code :
2334  !
2335  !/ ------------------------------------------------------------------- /
2336 
2337  USE w3gdatmd, only : nseal, nsea, nx, ny
2338  USE w3wdatmd, only : va
2339  USE w3odatmd, only : iaproc, naproc
2340  USE w3gdatmd, only : nspec, grids, gtype, ungtype
2341  USE yownodepool, only: npa, np, iplg
2342 
2343  INTEGER, INTENT(in) :: IMOD
2344  CHARACTER(*), INTENT(in) :: string
2345  INTEGER, INTENT(in) :: choice
2346  REAL :: FIELD(NSPEC,NSEAL)
2347  INTEGER ISPEC, JSEA, IP_glob, maxidx
2348  LOGICAL :: PrintMinISP = .false.
2349  LOGICAL :: LocalizeMaximum = .false.
2350  INTEGER :: TEST_IP = 46
2351  INTEGER :: TEST_ISP = 370
2352  IF (grids(imod)%GTYPE .ne. ungtype) THEN
2353  RETURN
2354  END IF
2355  IF (iaproc .gt. naproc) THEN
2356  RETURN
2357  END IF
2358  WRITE(740+iaproc,*) 'Entering ALL_INTEGRAL_PRINT, NSEAL=', nseal
2359  FLUSH(740+iaproc)
2360  IF (nseal .ne. npa) THEN
2361  print *, 'NSEAL=', nseal, " npa=", npa
2362  stop
2363  END IF
2364  DO jsea=1,nseal
2365  ip_glob=iplg(jsea)
2366  DO ispec=1,nspec
2367  field(ispec,jsea) = va(ispec,jsea)
2368  IF ((ip_glob .eq. test_ip).and.(ispec .eq. test_isp)) THEN
2369  WRITE(740+iaproc,*) 'ASS TEST_IP=', test_ip, ' TEST_ISP=', test_isp, ' val=', va(ispec,jsea)
2370  END IF
2371  END DO
2372  END DO
2373  WRITE(740+iaproc,*) 'Before call to ALL_FIELD_INTEGRAL'
2374  WRITE(740+iaproc,*) 'NSPEC=', nspec, ' NX=', nx
2375  FLUSH(740+iaproc)
2376  IF (choice .eq. 1) THEN
2377  maxidx = npa
2378  ELSE
2379  maxidx = np
2380  END IF
2381  CALL check_array_integral_nx_r8_maxfunct(field, string, maxidx, printminisp, localizemaximum)
2382  WRITE(740+iaproc,*) 'After call to ALL_FIELD_INTEGRAL'
2383  FLUSH(740+iaproc)

References check_array_integral_nx_r8_maxfunct(), w3gdatmd::grids, w3gdatmd::gtype, w3odatmd::iaproc, yownodepool::iplg, w3odatmd::naproc, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nx, w3gdatmd::ny, w3gdatmd::ungtype, and w3wdatmd::va.

Referenced by apply_boundary_condition(), pdlib_jacobi_gauss_seidel_block(), w3initmd::w3init(), and w3wavemd::w3wave().

◆ all_vaold_integral_print()

subroutine pdlib_w3profsmd::all_vaold_integral_print ( character(*), intent(in)  string,
integer, intent(in)  choice 
)

Definition at line 2220 of file w3profsmd_pdlib.F90.

2220  !/
2221  !/ +-----------------------------------+
2222  !/ | WAVEWATCH III NOAA/NCEP |
2223  !/ | |
2224  !/ | Aron Roland (BGS IT&E GmbH) |
2225  !/ | Mathieu Dutour-Sikiric (IRB) |
2226  !/ | |
2227  !/ | FORTRAN 90 |
2228  !/ | Last update : 01-June-2018 |
2229  !/ +-----------------------------------+
2230  !/
2231  !/ 01-June-2018 : Origination. ( version 6.04 )
2232  !/
2233  ! 1. Purpose : Source code for parallel debugging
2234  ! 2. Method :
2235  ! 3. Parameters :
2236  !
2237  ! Parameter list
2238  ! ----------------------------------------------------------------
2239  ! ----------------------------------------------------------------
2240  !
2241  ! 4. Subroutines used :
2242  !
2243  ! Name Type Module Description
2244  ! ----------------------------------------------------------------
2245  ! STRACE Subr. W3SERVMD Subroutine tracing.
2246  ! ----------------------------------------------------------------
2247  !
2248  ! 5. Called by :
2249  !
2250  ! Name Type Module Description
2251  ! ----------------------------------------------------------------
2252  ! ----------------------------------------------------------------
2253  !
2254  ! 6. Error messages :
2255  ! 7. Remarks
2256  ! 8. Structure :
2257  ! 9. Switches :
2258  !
2259  ! !/S Enable subroutine tracing.
2260  !
2261  ! 10. Source code :
2262  !
2263  !/ ------------------------------------------------------------------- /
2264 
2265  USE w3gdatmd, only : nseal
2266  USE w3wdatmd, only : vaold
2267  USE w3odatmd, only : iaproc
2268  USE w3gdatmd, only : nspec
2269  USE yownodepool, only: np, npa
2270 
2271  CHARACTER(*), INTENT(in) :: string
2272  INTEGER, INTENT(in) :: choice
2273  REAL :: FIELD(NSPEC,NSEAL)
2274  INTEGER ISPEC, JSEA, maxidx
2275  LOGICAL :: PrintMinISP = .false.
2276  LOGICAL :: LocalizeMaximum = .false.
2277  DO jsea=1,nseal
2278  DO ispec=1,nspec
2279  field(ispec,jsea) = vaold(ispec,jsea)
2280  END DO
2281  END DO
2282  IF (choice .eq. 1) THEN
2283  maxidx = npa
2284  ELSE
2285  maxidx = np
2286  END IF
2287  ! CALL ALL_FIELD_INTEGRAL_PRINT_GENERAL(FIELD, string)
2288  CALL check_array_integral_nx_r8_maxfunct(field, string, maxidx, printminisp, localizemaximum)

References check_array_integral_nx_r8_maxfunct(), w3odatmd::iaproc, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, and w3wdatmd::vaold.

Referenced by w3wavemd::w3wave().

◆ apply_boundary_condition()

subroutine pdlib_w3profsmd::apply_boundary_condition ( integer, intent(in)  IMOD)

Definition at line 5141 of file w3profsmd_pdlib.F90.

5141  !/
5142  !/ +-----------------------------------+
5143  !/ | WAVEWATCH III NOAA/NCEP |
5144  !/ | |
5145  !/ | Aron Roland (BGS IT&E GmbH) |
5146  !/ | Mathieu Dutour-Sikiric (IRB) |
5147  !/ | |
5148  !/ | FORTRAN 90 |
5149  !/ | Last update : 01-June-2018 |
5150  !/ +-----------------------------------+
5151  !/
5152  !/ 01-June-2018 : Origination. ( version 6.04 )
5153  !/
5154  ! 1. Purpose : Apply boundary conditions
5155  ! 2. Method :
5156  ! 3. Parameters :
5157  !
5158  ! Parameter list
5159  ! ----------------------------------------------------------------
5160  ! ----------------------------------------------------------------
5161  !
5162  ! 4. Subroutines used :
5163  !
5164  ! Name Type Module Description
5165  ! ----------------------------------------------------------------
5166  ! STRACE Subr. W3SERVMD Subroutine tracing.
5167  ! ----------------------------------------------------------------
5168  !
5169  ! 5. Called by :
5170  !
5171  ! Name Type Module Description
5172  ! ----------------------------------------------------------------
5173  ! ----------------------------------------------------------------
5174  !
5175  ! 6. Error messages :
5176  ! 7. Remarks
5177  ! 8. Structure :
5178  ! 9. Switches :
5179  !
5180  ! !/S Enable subroutine tracing.
5181  !
5182  ! 10. Source code :
5183  !
5184  !/ ------------------------------------------------------------------- /
5185 #ifdef W3_S
5186  USE w3servmd, only: strace
5187 #endif
5188  USE yownodepool, only: npa, np
5189  USE yowrankmodule, only : ipgl_npa
5190  USE w3gdatmd, only: nseal, clats, mapsf
5191  USE w3wdatmd, only: time
5192  USE w3timemd, only: dsec21
5193  USE w3wdatmd, only : va
5194  USE w3adatmd, only: cg, cx, cy
5195  USE w3gdatmd, only: nk, nk2, nth, nspec
5196  USE w3odatmd, only: tbpi0, tbpin, flbpi, iaproc, bbpi0, bbpin, isbpi, nbi
5198 #ifdef W3_DEBUGIOBC
5199  USE w3gdatmd, only: dden
5200 #endif
5201  !/
5202  INTEGER, INTENT(IN) :: IMOD
5203  !/
5204  !/ ------------------------------------------------------------------- /
5205  !/ Parameter list
5206  !/
5207  !/ ------------------------------------------------------------------- /
5208  !/ Local PARAMETERs
5209  !/
5210 #ifdef W3_S
5211  INTEGER, SAVE :: IENT = 0
5212 #endif
5213  !/
5214  !/ ------------------------------------------------------------------- /
5215  !/
5216 #ifdef W3_DEBUGSOLVER
5217  real*8 :: sumac(nspec)
5218  REAL :: sumBPI0(NSPEC), sumBPIN(NSPEC), sumCG, sumCLATS
5219 #endif
5220 #ifdef W3_DEBUGIOBC
5221  REAL :: ETOT, HSIG_bound, eVA, eAC, FACTOR
5222 #endif
5223  REAL :: RD1, RD2, RD10, RD20
5224  INTEGER :: IK, ITH, ISEA
5225  INTEGER :: IBI, IP_glob, ISP, JX
5226 #ifdef W3_S
5227  CALL strace (ient, 'APPLY_BOUNDARY_CONDITION')
5228 #endif
5229 #ifdef W3_DEBUGSOLVERCOH
5230  CALL all_va_integral_print(imod, "VA(np) before boundary", 0)
5231  CALL all_va_integral_print(imod, "VA(npa) before boundary", 1)
5232 #endif
5233  IF ( flbpi ) THEN
5234  rd10 = dsec21( tbpi0, time )
5235  rd20 = dsec21( tbpi0, tbpin )
5236  ELSE
5237  rd10=1.
5238  rd20=0.
5239  END IF
5240  IF ( flbpi ) THEN
5241  rd1=rd10 ! I am not completely sure about that
5242  rd2=rd20
5243  IF ( rd2 .GT. 0.001 ) THEN
5244  rd2 = min(1.,max(0.,rd1/rd2))
5245  rd1 = 1. - rd2
5246  ELSE
5247  rd1 = 0.
5248  rd2 = 1.
5249  END IF
5250 #ifdef W3_DEBUGSOLVER
5251  WRITE(740+iaproc,*) 'Begin of APPLY_BOUNDARY_CONDITION'
5252  WRITE(740+iaproc,*) 'NBI=', nbi
5253  FLUSH(740+iaproc)
5254  sumac=0
5255  sumbpi0=0
5256  sumbpin=0
5257  sumcg=0
5258  sumclats=0
5259 #endif
5260  DO ibi=1, nbi
5261  isea = isbpi(ibi)
5262  ip_glob = mapsf(isea,1)
5263  jx = ipgl_npa(ip_glob)
5264  IF (jx .gt. 0) THEN
5265  DO ith=1,nth
5266  DO ik=1,nk
5267  isp=ith + (ik-1)*nth
5268  va(isp,jx) = (( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) &
5269  / cg(ik,isbpi(ibi)) * clats(isbpi(ibi))) * iobdp_loc(jx)
5270  END DO
5271  END DO
5272 #ifdef W3_DEBUGIOBC
5273  etot=0
5274  DO ith=1,nth
5275  DO ik=1,nk
5276  factor = dden(ik)/cg(ik,isea)
5277  isp=ith + (ik-1)*nth
5278  eac=real(va(isp,jx))
5279  eva=cg(ik,isea)/clats(isea)*eac
5280  etot = etot + eva*factor
5281  END DO
5282  END DO
5283  hsig_bound=4.*sqrt(etot)
5284  WRITE(740+iaproc,*) 'IBI=', ibi, ' HSIG=', hsig_bound
5285 #endif
5286 
5287 #ifdef W3_DEBUGSOLVER
5288  sumac=sumac + va(:,jx)
5289  sumbpi0=sumbpi0 + bbpi0(:,ibi)
5290  sumbpin=sumbpin + bbpin(:,ibi)
5291  sumcg=sumcg + cg(ik,isbpi(ibi))
5292  sumclats=sumclats + clats(isbpi(ibi))
5293 #endif
5294  END IF
5295  ENDDO
5296 #ifdef W3_DEBUGSOLVER
5297  WRITE(740+iaproc,*) 'RD1=', rd1, ' RD2=', rd2
5298 #endif
5299 #ifdef W3_DEBUGSOLVERALL
5300  DO isp=1,nspec
5301  WRITE(740+iaproc,*) 'RD1=', rd1, ' RD2=', rd2
5302  WRITE(740+iaproc,*) 'ISP=', isp, 'sumAC=', sumac(isp)
5303  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPI0=', sumbpi0(isp)
5304  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPIN=', sumbpin(isp)
5305  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCG=', sumcg
5306  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCLATS=', sumclats
5307  END DO
5308 #endif
5309 #ifdef W3_DEBUGSOLVER
5310  WRITE(740+iaproc,*) 'Begin of APPLY_BOUNDARY_CONDITION'
5311  FLUSH(740+iaproc)
5312 #endif
5313 #ifdef W3_DEBUGSOLVERCOH
5314  CALL all_va_integral_print(imod, "VA(np) after boundary", 0)
5315  CALL all_va_integral_print(imod, "VA(npa) after boundary", 1)
5316 #endif
5317  END IF

References all_va_integral_print(), w3odatmd::bbpi0, w3odatmd::bbpin, w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dden, w3timemd::dsec21(), w3odatmd::flbpi, w3odatmd::iaproc, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yowrankmodule::ipgl_npa, w3odatmd::isbpi, w3gdatmd::mapsf, w3odatmd::nbi, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3servmd::strace(), w3odatmd::tbpi0, w3odatmd::tbpin, w3wdatmd::time, and w3wdatmd::va.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ apply_boundary_condition_va()

subroutine pdlib_w3profsmd::apply_boundary_condition_va

Definition at line 5026 of file w3profsmd_pdlib.F90.

5026  !/
5027  !/ +-----------------------------------+
5028  !/ | WAVEWATCH III NOAA/NCEP |
5029  !/ | |
5030  !/ | Aron Roland (BGS IT&E GmbH) |
5031  !/ | Mathieu Dutour-Sikiric (IRB) |
5032  !/ | |
5033  !/ | FORTRAN 90 |
5034  !/ | Last update : 01-June-2018 |
5035  !/ +-----------------------------------+
5036  !/
5037  !/ 01-June-2018 : Origination. ( version 6.04 )
5038  !/
5039  ! 1. Purpose : Boudary conditions on VA
5040  ! 2. Method :
5041  ! 3. Parameters :
5042  !
5043  ! Parameter list
5044  ! ----------------------------------------------------------------
5045  ! ----------------------------------------------------------------
5046  !
5047  ! 4. Subroutines used :
5048  !
5049  ! Name Type Module Description
5050  ! ----------------------------------------------------------------
5051  ! STRACE Subr. W3SERVMD Subroutine tracing.
5052  ! ----------------------------------------------------------------
5053  !
5054  ! 5. Called by :
5055  !
5056  ! Name Type Module Description
5057  ! ----------------------------------------------------------------
5058  ! ----------------------------------------------------------------
5059  !
5060  ! 6. Error messages :
5061  ! 7. Remarks
5062  ! 8. Structure :
5063  ! 9. Switches :
5064  !
5065  ! !/S Enable subroutine tracing.
5066  !
5067  ! 10. Source code :
5068  !
5069  !/ ------------------------------------------------------------------- /
5070 #ifdef W3_S
5071  USE w3servmd, only: strace
5072 #endif
5073  USE yowrankmodule, only : ipgl_npa
5074  USE w3gdatmd, only: nseal, clats, gtype, ungtype
5075  USE w3wdatmd, only: time
5076  USE w3timemd, only: dsec21
5077  USE w3adatmd, only: cg, cx, cy
5078  USE w3wdatmd, only: va
5079  USE w3gdatmd, only: nk, nk2, nth, ecos, esin, nspec
5080  USE w3odatmd, only: tbpi0, tbpin, flbpi, iaproc, naproc, bbpi0, bbpin, isbpi, nbi
5081  USE w3parall, only : isea_to_jsea
5082  !/
5083  !/
5084  !/ ------------------------------------------------------------------- /
5085  !/ Parameter list
5086  !/
5087  !/ ------------------------------------------------------------------- /
5088  !/ Local PARAMETERs
5089  !/
5090 #ifdef W3_S
5091  INTEGER, SAVE :: IENT = 0
5092 #endif
5093  !/
5094  !/ ------------------------------------------------------------------- /
5095  !/
5096  REAL :: RD1, RD2, RD10, RD20
5097  REAL :: eVA, eAC
5098  INTEGER :: IK, ITH, ISEA, JSEA
5099  INTEGER :: IBI, ISP
5100 #ifdef W3_S
5101  CALL strace (ient, 'APPLY_BOUNDARY_CONDITION_VA')
5102 #endif
5103  IF (gtype .eq. ungtype) THEN
5104  IF ( flbpi ) THEN
5105  rd10 = dsec21( tbpi0, time )
5106  rd20 = dsec21( tbpi0, tbpin )
5107  ELSE
5108  rd10=1.
5109  rd20=0.
5110  END IF
5111  IF (flbpi .and. (iaproc .le. naproc)) THEN
5112  rd1=rd10 ! I am not completely sure about that
5113  rd2=rd20
5114  IF ( rd2 .GT. 0.001 ) THEN
5115  rd2 = min(1.,max(0.,rd1/rd2))
5116  rd1 = 1. - rd2
5117  ELSE
5118  rd1 = 0.
5119  rd2 = 1.
5120  END IF
5121  DO ibi=1, nbi
5122  isea=isbpi(ibi)
5123  jsea=isea_to_jsea(isea)
5124  IF (jsea .gt. 0) THEN
5125  DO ith=1,nth
5126  DO ik=1,nk
5127  isp=ith + (ik-1)*nth
5128  eac = ( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) &
5129  / cg(ik,isbpi(ibi)) * clats(isbpi(ibi))
5130  eva = max(0., cg(ik,isea)/clats(isea)*eac)
5131  va(isp,jsea) = eva
5132  END DO
5133  END DO
5134  END IF
5135  END DO
5136  END IF
5137  END IF

References w3odatmd::bbpi0, w3odatmd::bbpin, w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3timemd::dsec21(), w3gdatmd::ecos, w3gdatmd::esin, w3odatmd::flbpi, w3gdatmd::gtype, w3odatmd::iaproc, yowrankmodule::ipgl_npa, w3odatmd::isbpi, w3parall::isea_to_jsea, w3odatmd::naproc, w3odatmd::nbi, w3gdatmd::nk, w3gdatmd::nk2, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3servmd::strace(), w3odatmd::tbpi0, w3odatmd::tbpin, w3wdatmd::time, w3gdatmd::ungtype, and w3wdatmd::va.

Referenced by w3wavemd::w3wave().

◆ block_solver_explicit_init()

subroutine pdlib_w3profsmd::block_solver_explicit_init

Definition at line 6610 of file w3profsmd_pdlib.F90.

6610  !/
6611  !/ +-----------------------------------+
6612  !/ | WAVEWATCH III NOAA/NCEP |
6613  !/ | |
6614  !/ | Aron Roland (BGS IT&E GmbH) |
6615  !/ | Mathieu Dutour-Sikiric (IRB) |
6616  !/ | |
6617  !/ | FORTRAN 90 |
6618  !/ | Last update : 01-June-2018 |
6619  !/ +-----------------------------------+
6620  !/
6621  !/ 01-June-2018 : Origination. ( version 6.04 )
6622  !/
6623  ! 1. Purpose : Initialization of the block solver
6624  ! 2. Method :
6625  ! 3. Parameters :
6626  !
6627  ! Parameter list
6628  ! ----------------------------------------------------------------
6629  ! ----------------------------------------------------------------
6630  !
6631  ! 4. Subroutines used :
6632  !
6633  ! Name Type Module Description
6634  ! ----------------------------------------------------------------
6635  ! STRACE Subr. W3SERVMD Subroutine tracing.
6636  ! ----------------------------------------------------------------
6637  !
6638  ! 5. Called by :
6639  !
6640  ! Name Type Module Description
6641  ! ----------------------------------------------------------------
6642  ! ----------------------------------------------------------------
6643  !
6644  ! 6. Error messages :
6645  ! 7. Remarks
6646  ! 8. Structure :
6647  ! 9. Switches :
6648  !
6649  ! !/S Enable subroutine tracing.
6650  !
6651  ! 10. Source code :
6652  !
6653  !/ ------------------------------------------------------------------- /
6654 #ifdef W3_S
6655  USE w3servmd, only: strace
6656 #endif
6657  USE w3gdatmd, only: nth, nk
6658 #ifdef W3_PDLIB
6659  USE yownodepool, only: np, npa
6660  USE yowelementpool, only: ne
6661 #endif
6662  IMPLICIT NONE
6663  !/
6664 
6665  ALLOCATE(flall1(nth,ne,nk), flall2(nth,ne,nk), flall3(nth,ne,nk))
6666  ALLOCATE(kelem1(nth,ne,nk), kelem2(nth,ne,nk), kelem3(nth,ne,nk))
6667  ALLOCATE(nm(nth,ne,nk), dtsi(npa))
6668  ALLOCATE(iter(nk))
6669 
6670  !/ ------------------------------------------------------------------- /
6671  !/

References dtsi, flall1, flall2, flall3, iter, kelem1, kelem2, kelem3, yowelementpool::ne, w3gdatmd::nk, nm, yownodepool::np, yownodepool::npa, w3gdatmd::nth, and w3servmd::strace().

Referenced by w3initmd::w3init().

◆ block_solver_finalize()

subroutine pdlib_w3profsmd::block_solver_finalize

Definition at line 7203 of file w3profsmd_pdlib.F90.

7203  !/
7204  !/ +-----------------------------------+
7205  !/ | WAVEWATCH III NOAA/NCEP |
7206  !/ | |
7207  !/ | Aron Roland (BGS IT&E GmbH) |
7208  !/ | Mathieu Dutour-Sikiric (IRB) |
7209  !/ | |
7210  !/ | FORTRAN 90 |
7211  !/ | Last update : 01-June-2018 |
7212  !/ +-----------------------------------+
7213  !/
7214  !/ 01-June-2018 : Origination. ( version 6.04 )
7215  !/
7216  ! 1. Purpose : Finalize Solver
7217  ! 2. Method :
7218  ! 3. Parameters :
7219  !
7220  ! Parameter list
7221  ! ----------------------------------------------------------------
7222  ! ----------------------------------------------------------------
7223  !
7224  ! 4. Subroutines used :
7225  !
7226  ! Name Type Module Description
7227  ! ----------------------------------------------------------------
7228  ! STRACE Subr. W3SERVMD Subroutine tracing.
7229  ! ----------------------------------------------------------------
7230  !
7231  ! 5. Called by :
7232  !
7233  ! Name Type Module Description
7234  ! ----------------------------------------------------------------
7235  ! ----------------------------------------------------------------
7236  !
7237  ! 6. Error messages :
7238  ! 7. Remarks
7239  ! 8. Structure :
7240  ! 9. Switches :
7241  !
7242  ! !/S Enable subroutine tracing.
7243  !
7244  ! 10. Source code :
7245  !
7246  !/ ------------------------------------------------------------------- /
7247 #ifdef W3_S
7248  USE w3servmd, only: strace
7249 #endif
7250  USE w3gdatmd, only: b_jgs_use_jacobi
7251  !/
7252  !/
7253  !/ ------------------------------------------------------------------- /
7254  !/ Parameter list
7255  !/
7256  !/ ------------------------------------------------------------------- /
7257  !/ Local PARAMETERs
7258  !/
7259 #ifdef W3_S
7260  INTEGER, SAVE :: IENT = 0
7261 #endif
7262  !/
7263  !/ ------------------------------------------------------------------- /
7264  !/
7265  !
7266 #ifdef W3_S
7267  CALL strace (ient, 'BLOCK_SOLVER_FINALIZE')
7268 #endif
7269  IF (b_jgs_use_jacobi) THEN
7270  CALL jacobi_finalize
7271  END IF
7272  !/
7273  !/ End of SETDEPTH_PDLIB --------------------------------------------- /
7274  !/

References w3gdatmd::b_jgs_use_jacobi, jacobi_finalize(), and w3servmd::strace().

◆ block_solver_init()

subroutine pdlib_w3profsmd::block_solver_init ( integer, intent(in)  IMOD)

Definition at line 6675 of file w3profsmd_pdlib.F90.

6675  !/
6676  !/ +-----------------------------------+
6677  !/ | WAVEWATCH III NOAA/NCEP |
6678  !/ | |
6679  !/ | Aron Roland (BGS IT&E GmbH) |
6680  !/ | Mathieu Dutour-Sikiric (IRB) |
6681  !/ | |
6682  !/ | FORTRAN 90 |
6683  !/ | Last update : 01-June-2018 |
6684  !/ +-----------------------------------+
6685  !/
6686  !/ 01-June-2018 : Origination. ( version 6.04 )
6687  !/
6688  ! 1. Purpose : Initialization of the block solver
6689  ! 2. Method :
6690  ! 3. Parameters :
6691  !
6692  ! Parameter list
6693  ! ----------------------------------------------------------------
6694  ! ----------------------------------------------------------------
6695  !
6696  ! 4. Subroutines used :
6697  !
6698  ! Name Type Module Description
6699  ! ----------------------------------------------------------------
6700  ! STRACE Subr. W3SERVMD Subroutine tracing.
6701  ! ----------------------------------------------------------------
6702  !
6703  ! 5. Called by :
6704  !
6705  ! Name Type Module Description
6706  ! ----------------------------------------------------------------
6707  ! ----------------------------------------------------------------
6708  !
6709  ! 6. Error messages :
6710  ! 7. Remarks
6711  ! 8. Structure :
6712  ! 9. Switches :
6713  !
6714  ! !/S Enable subroutine tracing.
6715  !
6716  ! 10. Source code :
6717  !
6718  !/ ------------------------------------------------------------------- /
6719 #ifdef W3_S
6720  USE w3servmd, only: strace
6721 #endif
6722  !
6723  USE constants, only : lpdlib, tpi, tpiinv
6724  USE w3gdatmd, only: mapsf, nseal, dmin, iobdp, mapsta, iobp, mapfs, nx
6725  USE w3adatmd, only: dw
6726  USE w3parall, only: init_get_isea
6727  USE yownodepool, only: iplg, np
6728  USE yowfunction, only: pdlib_abort
6729  use yownodepool, only: npa
6730  USE w3gdatmd, only: b_jgs_use_jacobi
6733  USE w3gdatmd, only: nspec, nth, nk
6734  USE w3gdatmd, only: fstotalimp
6735  USE w3odatmd, only: iaproc
6736  !/
6737  INTEGER, INTENT(IN) :: IMOD
6738  !
6739  !/ ------------------------------------------------------------------- /
6740  !/
6741  INTEGER ISP, ITH, IK, ISPprevFreq, ISPnextFreq
6742  INTEGER NewISP, JTH, istat
6743 
6744  pos_trick(1,1) = 2
6745  pos_trick(1,2) = 3
6746  pos_trick(2,1) = 3
6747  pos_trick(2,2) = 1
6748  pos_trick(3,1) = 1
6749  pos_trick(3,2) = 2
6750 
6751 #ifdef W3_DEBUGINIT
6752  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 1'
6753  FLUSH(740+iaproc)
6754 #endif
6755  ALLOCATE(listispnextdir(nspec), listispprevdir(nspec), listispnextfreq(nspec), listispprevfreq(nspec),stat=istat)
6756  IF (istat /= 0) CALL pdlib_abort(8)
6757 #ifdef W3_DEBUGINIT
6758  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 2'
6759  FLUSH(740+iaproc)
6760 #endif
6761  DO isp=1,nspec
6762  ith = 1 + mod(isp-1,nth)
6763  ik = 1 + (isp-1)/nth
6764  IF (ik .eq. 1) THEN
6765  ispprevfreq=-1
6766  ELSE
6767  ispprevfreq=ith + (ik-1 -1)*nth
6768  END IF
6769  listispprevfreq(isp)=ispprevfreq
6770  IF (ik .eq. nk) THEN
6771  ispnextfreq=-1
6772  ELSE
6773  ispnextfreq=ith + (ik+1 -1)*nth
6774  END IF
6775  listispnextfreq(isp)=ispnextfreq
6776  !
6777  IF (ith .eq. 1) THEN
6778  jth=nth
6779  ELSE
6780  jth=ith-1
6781  ENDIF
6782  newisp=jth + (ik-1)*nth
6783  listispprevdir(isp)=newisp
6784  IF (ith .eq. nth) THEN
6785  jth=1
6786  ELSE
6787  jth=ith+1
6788  ENDIF
6789  newisp=jth + (ik-1)*nth
6790  listispnextdir(isp)=newisp
6791  END DO
6792 #ifdef W3_DEBUGINIT
6793  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 3'
6794  FLUSH(740+iaproc)
6795 #endif
6796  IF (fstotalimp .and. b_jgs_use_jacobi) THEN
6797 #ifdef W3_DEBUGINIT
6798  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 4'
6799  FLUSH(740+iaproc)
6800 #endif
6801  CALL jacobi_init(imod)
6802 #ifdef W3_DEBUGINIT
6803  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 5'
6804  FLUSH(740+iaproc)
6805 #endif
6806  END IF
6807 #ifdef W3_DEBUGINIT
6808  WRITE(740+iaproc,*) 'BLOCK_SOLVER_INIT, step 6'
6809  FLUSH(740+iaproc)
6810 #endif

References w3gdatmd::b_jgs_use_jacobi, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::fstotalimp, w3odatmd::iaproc, w3parall::init_get_isea(), w3gdatmd::iobdp, w3gdatmd::iobp, yownodepool::iplg, jacobi_init(), w3parall::listispnextdir, w3parall::listispnextfreq, w3parall::listispprevdir, w3parall::listispprevfreq, constants::lpdlib, w3gdatmd::mapfs, w3gdatmd::mapsf, w3gdatmd::mapsta, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::nx, yowfunction::pdlib_abort(), pos_trick, w3servmd::strace(), constants::tpi, and constants::tpiinv.

Referenced by w3initmd::w3init().

◆ calcarray_jacobi()

subroutine pdlib_w3profsmd::calcarray_jacobi ( real, intent(in)  DTG,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  VGX,
real, intent(in)  VGY 
)

Definition at line 3292 of file w3profsmd_pdlib.F90.

3292  !/
3293  !/ +-----------------------------------+
3294  !/ | WAVEWATCH III NOAA/NCEP |
3295  !/ | |
3296  !/ | Aron Roland (BGS IT&E GmbH) |
3297  !/ | Mathieu Dutour-Sikiric (IRB) |
3298  !/ | |
3299  !/ | FORTRAN 90 |
3300  !/ | Last update : 01-June-2018 |
3301  !/ +-----------------------------------+
3302  !/
3303  !/ 01-June-2018 : Origination. ( version 6.04 )
3304  !/
3305  ! 1. Purpose : Compute matrix coefficients for advection part
3306  ! 2. Method :
3307  ! 3. Parameters :
3308  !
3309  ! Parameter list
3310  ! ----------------------------------------------------------------
3311  ! ----------------------------------------------------------------
3312  !
3313  ! 4. Subroutines used :
3314  !
3315  ! Name Type Module Description
3316  ! ----------------------------------------------------------------
3317  ! STRACE Subr. W3SERVMD Subroutine tracing.
3318  ! ----------------------------------------------------------------
3319  !
3320  ! 5. Called by :
3321  !
3322  ! Name Type Module Description
3323  ! ----------------------------------------------------------------
3324  ! ----------------------------------------------------------------
3325  !
3326  ! 6. Error messages :
3327  ! 7. Remarks
3328  ! 8. Structure :
3329  ! 9. Switches :
3330  !
3331  ! !/S Enable subroutine tracing.
3332  !
3333  ! 10. Source code :
3334  !
3335  !/ ------------------------------------------------------------------- /
3336 #ifdef W3_S
3337  USE w3servmd, only: strace
3338 #endif
3339  !
3340  USE w3gdatmd, only: nk, nk2, nth, nspec, fachfa, dmin
3342  USE w3gdatmd, only: nseal, clats
3343  USE w3gdatmd, only: mapsta
3344  USE w3wdatmd, only: va
3345  USE w3adatmd, only: cg, dw, wn, cx, cy
3346  USE w3idatmd, only: flcur, fllev
3347  USE w3gdatmd, only: ecos, esin, mapfs
3348  USE w3parall, only : onesixth, zero, thr
3349  use yowelementpool, only: ne, ine
3350  USE yownodepool, only: pdlib_ien, pdlib_tria, &
3354  USE w3odatmd, only : iaproc
3355  USE w3parall, only : zero
3356 #ifdef W3_DB1
3357  USE w3sdb1md
3358  USE w3gdatmd, only: sdbsc
3359 #endif
3360 #ifdef W3_BT1
3361  USE w3sbt1md
3362 #endif
3363 #ifdef W3_BT4
3364  USE w3sbt4md
3365 #endif
3366 #ifdef W3_BT8
3367  USE w3sbt8md
3368 #endif
3369 #ifdef W3_BT9
3370  USE w3sbt9md
3371 #endif
3372 #ifdef W3_IC1
3373  USE w3sic1md
3374 #endif
3375 #ifdef W3_IC2
3376  USE w3sic2md
3377 #endif
3378 #ifdef W3_IC3
3379  USE w3sic3md
3380 #endif
3381 #ifdef W3_TR1
3382  USE w3str1md
3383 #endif
3384  REAL, INTENT(in) :: DTG, FACX, FACY, VGX, VGY
3385  INTEGER :: IP, ISP, ISEA, IP_glob
3386  INTEGER :: idx, IS
3387  INTEGER :: I, J, ITH, IK, J2
3388  INTEGER :: IE, POS, JSEA
3389  INTEGER :: I1, I2, I3, NI(3)
3390  INTEGER :: counter
3391 #ifdef W3_REF1
3392  INTEGER :: eIOBPDR
3393 #endif
3394  REAL :: DTK, TMP3
3395  REAL :: LAMBDA(2)
3396  REAL :: FL11, FL12
3397  REAL :: FL21, FL22
3398  REAL :: FL31, FL32
3399  REAL :: CRFS(3), CXY(3,2)
3400  REAL :: KP(3,NSPEC,NE)
3401  REAL :: KM(3), K(3)
3402  REAL :: K1, eSI, eVS, eVD
3403  REAL :: eVal1, eVal2, eVal3
3404  REAL :: DELTAL(3,NSPEC,NE)
3405  REAL :: NM(NSPEC,NE)
3406  REAL :: TRIA03, SIDT, CCOS, CSIN
3407  REAL :: SPEC(NSPEC), DEPTH
3408 
3409 #ifdef W3_DEBUGSOLVER
3410  WRITE(740+iaproc,*) 'calcARRAY_JACOBI, begin'
3411  FLUSH(740+iaproc)
3412 #endif
3413  memunit = 50000+iaproc
3414 
3415  i = 0
3416  ie = 0
3417  pos = 0
3418  i1 = 0
3419  i2 = 0
3420  i3 = 0
3421  dtk = 0
3422  tmp3 = 0
3423 
3424  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 0')
3425 
3426  DO ie = 1, ne
3427  i1 = ine(1,ie)
3428  i2 = ine(2,ie)
3429  i3 = ine(3,ie)
3430  ni = ine(:,ie)
3431  DO is = 1, nspec
3432  ith = 1 + mod(is-1,nth)
3433  ik = 1 + (is-1)/nth
3434  ccos = facx * ecos(ith)
3435  csin = facy * esin(ith)
3436  cxy(:,1) = ccos * cg(ik,ni) / clats(ni)
3437  cxy(:,2) = csin * cg(ik,ni)
3438  IF (flcur) THEN
3439  cxy(:,1) = cxy(:,1) + facx * cx(ni)/clats(ni)
3440  cxy(:,2) = cxy(:,2) + facy * cy(ni)
3441  ENDIF
3442 #ifdef W3_MGP
3443  cxy(:,1) = cxy(:,1) - ccurx*vgx/clats(isea)
3444  cxy(:,2) = cxy(:,2) - ccury*vgy
3445 #endif
3446  fl11 = cxy(2,1)*pdlib_ien(1,ie)+cxy(2,2)*pdlib_ien(2,ie)
3447  fl12 = cxy(3,1)*pdlib_ien(1,ie)+cxy(3,2)*pdlib_ien(2,ie)
3448  fl21 = cxy(3,1)*pdlib_ien(3,ie)+cxy(3,2)*pdlib_ien(4,ie)
3449  fl22 = cxy(1,1)*pdlib_ien(3,ie)+cxy(1,2)*pdlib_ien(4,ie)
3450  fl31 = cxy(1,1)*pdlib_ien(5,ie)+cxy(1,2)*pdlib_ien(6,ie)
3451  fl32 = cxy(2,1)*pdlib_ien(5,ie)+cxy(2,2)*pdlib_ien(6,ie)
3452  crfs(1) = - onesixth * (2.0d0 *fl31 + fl32 + fl21 + 2.0d0 * fl22 )
3453  crfs(2) = - onesixth * (2.0d0 *fl32 + 2.0d0 * fl11 + fl12 + fl31 )
3454  crfs(3) = - onesixth * (2.0d0 *fl12 + 2.0d0 * fl21 + fl22 + fl11 )
3455  lambda(1) = onesixth * sum(cxy(:,1))
3456  lambda(2) = onesixth * sum(cxy(:,2))
3457  k(1) = lambda(1) * pdlib_ien(1,ie) + lambda(2) * pdlib_ien(2,ie)
3458  k(2) = lambda(1) * pdlib_ien(3,ie) + lambda(2) * pdlib_ien(4,ie)
3459  k(3) = lambda(1) * pdlib_ien(5,ie) + lambda(2) * pdlib_ien(6,ie)
3460  kp(:,is,ie) = max(zero,k(:))
3461  deltal(:,is,ie) = crfs(:) - kp(:,is,ie)
3462  km(:) = min(zero,k(:))
3463  nm(is,ie) = 1.d0/min(-thr,sum(km))
3464  ENDDO
3465  END DO
3466 
3467  j = 0
3468  DO ip = 1, npa
3469  ip_glob=iplg(ip)
3470  DO i = 1, pdlib_ccon(ip)
3471  j = j + 1
3472  ie = pdlib_ie_cell2(i,ip)
3473  pos = pdlib_pos_cell2(i,ip)
3474  i1 = pdlib_posi(1,j)
3475  i2 = pdlib_posi(2,j)
3476  i3 = pdlib_posi(3,j)
3477 #ifdef W3_DEBUGSRC
3478  WRITE(740+iaproc,*) 'I1=', i1, ' PDLIB_I_DIAG=', pdlib_i_diag(ip)
3479 #endif
3480  DO isp=1,nspec
3481  ith = 1 + mod(isp-1,nth)
3482  ik = 1 + (isp-1)/nth
3483  k1 = kp(pos,isp,ie)
3484 #ifdef W3_REF1
3485  eiobpdr=(1-iobp_loc(ip_glob))*(1-iobpd_loc(ith,ip_glob))
3486  IF (eiobpdr .eq. 1) THEN
3487  k1=zero
3488  END IF
3489 #endif
3490  tria03 = 1./3. * pdlib_tria(ie)
3491  dtk = k1 * dtg * iobdp_loc(ip) * (1-iobpa_loc(ip)) * iobpd_loc(ith,ip)
3492  b_jac(isp,ip) = b_jac(isp,ip) + tria03 * va(isp,ip) * iobdp_loc(ip) * (1-iobpa_loc(ip)) * iobpd_loc(ith,ip)
3493  tmp3 = dtk * nm(isp,ie)
3494  IF (fsgeoadvect) THEN
3495  aspar_jac(isp,i1) = aspar_jac(isp,i1) + tria03 + dtk - tmp3*deltal(pos,isp,ie)
3496  aspar_jac(isp,i2) = aspar_jac(isp,i2) - tmp3*deltal(pos_trick(pos,1),isp,ie)
3497  aspar_jac(isp,i3) = aspar_jac(isp,i3) - tmp3*deltal(pos_trick(pos,2),isp,ie)
3498  ELSE
3499  aspar_jac(isp,i1) = aspar_jac(isp,i1) + tria03
3500  END IF
3501  END DO
3502  END DO
3503  END DO
3504  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 1')
3505 #ifdef W3_DEBUGSOLVER
3506  WRITE(740+iaproc,*) 'sum(VA)=', sum(va)
3507  CALL printtotaloffcontrib("Offdiag after the geo advection")
3508 #endif
3509  !/
3510  !/ End of W3XYPFSN ----------------------------------------------------- /
3511  !/

References aspar_jac, b_jac, w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, fsgeoadvect, w3odatmd::iaproc, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, memunit, yowelementpool::ne, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3parall::onesixth, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia, yownodepool::pdlib_ia_p, yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_pos_cell2, yownodepool::pdlib_posi, yownodepool::pdlib_tria, pos_trick, printtotaloffcontrib(), w3gdatmd::sdbsc, w3servmd::strace(), w3parall::thr, w3wdatmd::va, w3adatmd::wn, and w3parall::zero.

◆ calcarray_jacobi2()

subroutine pdlib_w3profsmd::calcarray_jacobi2 ( real, intent(in)  DTG,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  VGX,
real, intent(in)  VGY 
)

Definition at line 3761 of file w3profsmd_pdlib.F90.

3761  !/
3762  !/ +-----------------------------------+
3763  !/ | WAVEWATCH III NOAA/NCEP |
3764  !/ | |
3765  !/ | Aron Roland (BGS IT&E GmbH) |
3766  !/ | Mathieu Dutour-Sikiric (IRB) |
3767  !/ | |
3768  !/ | FORTRAN 90 |
3769  !/ | Last update : 01-June-2018 |
3770  !/ +-----------------------------------+
3771  !/
3772  !/ 01-June-2018 : Origination. ( version 6.04 )
3773  !/
3774  ! 1. Purpose : Compute matrix coefficients for advection part
3775  ! 2. Method :
3776  ! 3. Parameters :
3777  !
3778  ! Parameter list
3779  ! ----------------------------------------------------------------
3780  ! ----------------------------------------------------------------
3781  !
3782  ! 4. Subroutines used :
3783  !
3784  ! Name Type Module Description
3785  ! ----------------------------------------------------------------
3786  ! STRACE Subr. W3SERVMD Subroutine tracing.
3787  ! ----------------------------------------------------------------
3788  !
3789  ! 5. Called by :
3790  !
3791  ! Name Type Module Description
3792  ! ----------------------------------------------------------------
3793  ! ----------------------------------------------------------------
3794  !
3795  ! 6. Error messages :
3796  ! 7. Remarks
3797  ! 8. Structure :
3798  ! 9. Switches :
3799  !
3800  ! !/S Enable subroutine tracing.
3801  !
3802  ! 10. Source code :
3803  !
3804  !/ ------------------------------------------------------------------- /
3805 #ifdef W3_S
3806  USE w3servmd, only: strace
3807 #endif
3808  !
3809 
3810  USE w3gdatmd, only: nk, nk2, nth, nspec, fachfa, dmin
3812  USE w3gdatmd, only: nseal, clats
3813  USE w3gdatmd, only: mapsta
3814  USE w3wdatmd, only: va, vaold
3815  USE w3adatmd, only: cg, dw, wn, cx, cy
3816  USE w3idatmd, only: flcur, fllev
3817  USE w3gdatmd, only: ecos, esin, mapfs
3818  USE w3parall, only : onesixth, zero, thr, imem
3819  use yowelementpool, only: ne, ine
3820  USE yownodepool, only: pdlib_ien, pdlib_tria, &
3824  USE w3odatmd, only : iaproc
3825 #ifdef W3_DB1
3826  USE w3sdb1md
3827  USE w3gdatmd, only: sdbsc
3828 #endif
3829 #ifdef W3_BT1
3830  USE w3sbt1md
3831 #endif
3832 #ifdef W3_BT4
3833  USE w3sbt4md
3834 #endif
3835 #ifdef W3_BT8
3836  USE w3sbt8md
3837 #endif
3838 #ifdef W3_BT9
3839  USE w3sbt9md
3840 #endif
3841 #ifdef W3_IC1
3842  USE w3sic1md
3843 #endif
3844 #ifdef W3_IC2
3845  USE w3sic2md
3846 #endif
3847 #ifdef W3_IC3
3848  USE w3sic3md
3849 #endif
3850 #ifdef W3_TR1
3851  USE w3str1md
3852 #endif
3853  REAL, INTENT(in) :: DTG, FACX, FACY, VGX, VGY
3854  INTEGER :: IP, ISP, ISEA, IP_glob
3855  INTEGER :: idx, IS
3856  INTEGER :: I, J, ITH, IK, J2
3857  INTEGER :: IE, POS, JSEA
3858  INTEGER :: I1, I2, I3, NI(3), NI_GLOB(3), NI_ISEA(3)
3859  INTEGER :: counter
3860 #ifdef W3_REF1
3861  INTEGER :: eIOBPDR
3862 #endif
3863  INTEGER :: IP1, IP2, IPP1, IPP2
3864  REAL :: DTK, TMP3
3865  REAL :: LAMBDA(2)
3866  REAL :: FL11, FL12
3867  REAL :: FL21, FL22
3868  REAL :: FL31, FL32
3869  REAL :: CRFS(3), K(3)
3870  REAL :: KP(3)
3871  REAL :: KM(3), CXY(3,2)
3872  REAL :: K1, eSI, eVS, eVD
3873  REAL :: eVal1, eVal2, eVal3
3874  REAL :: DELTAL(3)
3875  REAL :: NM, TRIA03, SIDT
3876  REAL :: IEN_LOCAL(6), CG2(NK,NTH)
3877  REAL :: CCOS, CSIN
3878  REAL :: SPEC(NSPEC), DEPTH
3879 
3880  memunit = 50000+iaproc
3881 
3882  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 0')
3883 
3884  j = 0
3885  DO ip = 1, npa
3886  ip_glob=iplg(ip)
3887  isea=mapfs(1,ip_glob)
3888  DO i = 1, pdlib_ccon(ip)
3889  j = j + 1
3890  ie = pdlib_ie_cell2(i,ip)
3891  ien_local = pdlib_ien(:,ie)
3892  pos = pdlib_pos_cell2(i,ip)
3893  i1 = pdlib_posi(1,j)
3894  i2 = pdlib_posi(2,j)
3895  i3 = pdlib_posi(3,j)
3896  ip1 = ine(pos_trick(pos,1),ie)
3897  ip2 = ine(pos_trick(pos,2),ie)
3898  ipp1 = pos_trick(pos,1)
3899  ipp2 = pos_trick(pos,2)
3900  ni = ine(:,ie)
3901  ni_glob = iplg(ni)
3902  ni_isea = mapfs(1,ni_glob)
3903  DO isp=1,nspec
3904  ith = 1 + mod(isp-1,nth)
3905  ik = 1 + (isp-1)/nth
3906  ccos = facx * ecos(ith)
3907  csin = facy * esin(ith)
3908  cxy(:,1) = ccos * cg(ik,ni_isea) / clats(ni_isea)
3909  cxy(:,2) = csin * cg(ik,ni_isea)
3910  IF (flcur) THEN
3911  cxy(:,1) = cxy(:,1) + facx * cx(ni_isea)/clats(ni_isea)
3912  cxy(:,2) = cxy(:,2) + facy * cy(ni_isea)
3913  ENDIF
3914 #ifdef W3_MGP
3915  cxy(:,1) = cxy(:,1) - ccurx*vgx/clats(isea)
3916  cxy(:,2) = cxy(:,2) - ccury*vgy
3917 #endif
3918  fl11 = cxy(2,1)*ien_local(1)+cxy(2,2)*ien_local(2)
3919  fl12 = cxy(3,1)*ien_local(1)+cxy(3,2)*ien_local(2)
3920  fl21 = cxy(3,1)*ien_local(3)+cxy(3,2)*ien_local(4)
3921  fl22 = cxy(1,1)*ien_local(3)+cxy(1,2)*ien_local(4)
3922  fl31 = cxy(1,1)*ien_local(5)+cxy(1,2)*ien_local(6)
3923  fl32 = cxy(2,1)*ien_local(5)+cxy(2,2)*ien_local(6)
3924  crfs(1) = - onesixth * (2.0d0 *fl31 + fl32 + fl21 + 2.0d0 * fl22 )
3925  crfs(2) = - onesixth * (2.0d0 *fl32 + 2.0d0 * fl11 + fl12 + fl31 )
3926  crfs(3) = - onesixth * (2.0d0 *fl12 + 2.0d0 * fl21 + fl22 + fl11 )
3927  lambda(1) = onesixth * sum(cxy(:,1))
3928  lambda(2) = onesixth * sum(cxy(:,2))
3929  k(1) = lambda(1) * ien_local(1) + lambda(2) * ien_local(2)
3930  k(2) = lambda(1) * ien_local(3) + lambda(2) * ien_local(4)
3931  k(3) = lambda(1) * ien_local(5) + lambda(2) * ien_local(6)
3932  kp(:) = max(zero,k(:))
3933  deltal(:) = crfs(:) - kp(:)
3934  km(:) = min(zero,k(:))
3935  nm = 1.d0/min(-thr,sum(km))
3936  k1 = kp(pos)
3937 #ifdef W3_REF1
3938  eiobpdr=(1-iobp_loc(ip))*(1-iobpd_loc(ith,ip))
3939  IF (eiobpdr .eq. 1) THEN
3940  k1=zero
3941  END IF
3942 #endif
3943  tria03 = 1./3. * pdlib_tria(ie)
3944  dtk = k1 * dtg * iobdp_loc(ip) * iobpd_loc(ith,ip) * (1-iobpa_loc(ip))
3945  tmp3 = dtk * nm
3946  IF (fsgeoadvect) THEN
3947  aspar_jac(isp,i1) = aspar_jac(isp,i1) + tria03 + dtk - tmp3*deltal(pos)
3948  aspar_jac(isp,i2) = aspar_jac(isp,i2) - tmp3*deltal(ipp1)
3949  aspar_jac(isp,i3) = aspar_jac(isp,i3) - tmp3*deltal(ipp2)
3950  ELSE
3951  aspar_jac(isp,i1) = aspar_jac(isp,i1) + tria03
3952  END IF
3953  b_jac(isp,ip) = b_jac(isp,ip) + tria03 * va(isp,ip) * iobdp_loc(ip) * iobpd_loc(ith,ip)
3954  END DO
3955  END DO
3956  END DO
3957  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 1')
3958  !/
3959  !/ End of W3XYPFSN ----------------------------------------------------- /
3960  !/

References aspar_jac, b_jac, w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, fsgeoadvect, w3odatmd::iaproc, w3parall::imem, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, memunit, yowelementpool::ne, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3parall::onesixth, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia, yownodepool::pdlib_ia_p, yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_pos_cell2, yownodepool::pdlib_posi, yownodepool::pdlib_tria, pos_trick, w3gdatmd::sdbsc, w3servmd::strace(), w3parall::thr, w3wdatmd::va, w3wdatmd::vaold, w3adatmd::wn, and w3parall::zero.

◆ calcarray_jacobi3()

subroutine pdlib_w3profsmd::calcarray_jacobi3 ( integer, intent(in)  IP,
integer, intent(inout)  J,
real, intent(in)  DTG,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  VGX,
real, intent(in)  VGY,
real, dimension(nspec), intent(out)  ASPAR_DIAG_LOCAL,
real, dimension(nspec), intent(out)  ASPAR_OFF_DIAG_LOCAL,
real, dimension(nspec), intent(out)  B_JAC_LOCAL 
)

Definition at line 3964 of file w3profsmd_pdlib.F90.

3964  !/
3965  !/ +-----------------------------------+
3966  !/ | WAVEWATCH III NOAA/NCEP |
3967  !/ | |
3968  !/ | Aron Roland (BGS IT&E GmbH) |
3969  !/ | Mathieu Dutour-Sikiric (IRB) |
3970  !/ | |
3971  !/ | FORTRAN 90 |
3972  !/ | Last update : 01-June-2018 |
3973  !/ +-----------------------------------+
3974  !/
3975  !/ 01-June-2018 : Origination. ( version 6.04 )
3976  !/
3977  ! 1. Purpose : Compute matrix coefficients for advection part
3978  ! 2. Method :
3979  ! 3. Parameters :
3980  !
3981  ! Parameter list
3982  ! ----------------------------------------------------------------
3983  ! ----------------------------------------------------------------
3984  !
3985  ! 4. Subroutines used :
3986  !
3987  ! Name Type Module Description
3988  ! ----------------------------------------------------------------
3989  ! STRACE Subr. W3SERVMD Subroutine tracing.
3990  ! ----------------------------------------------------------------
3991  !
3992  ! 5. Called by :
3993  !
3994  ! Name Type Module Description
3995  ! ----------------------------------------------------------------
3996  ! ----------------------------------------------------------------
3997  !
3998  ! 6. Error messages :
3999  ! 7. Remarks
4000  ! 8. Structure :
4001  ! 9. Switches :
4002  !
4003  ! !/S Enable subroutine tracing.
4004  !
4005  ! 10. Source code :
4006  !
4007  !/ ------------------------------------------------------------------- /
4008 #ifdef W3_S
4009  USE w3servmd, only: strace
4010 #endif
4011  !
4012  USE w3gdatmd, only: nk, nk2, nth, nspec, fachfa, dmin
4014  USE w3gdatmd, only: nseal, clats
4015  USE w3gdatmd, only: mapsta
4016  USE w3wdatmd, only: va, vaold
4017  USE w3adatmd, only: cg, dw, wn, cx, cy
4018  USE w3idatmd, only: flcur, fllev
4019  USE w3gdatmd, only: ecos, esin, mapfs
4020  USE w3parall, only : onesixth, zero, thr, onethird
4021  use yowelementpool, only: ne, ine
4022  USE yownodepool, only: pdlib_ien, pdlib_tria, &
4026  USE w3gdatmd, only: iobp
4027  USE w3odatmd, only : iaproc
4028 #ifdef W3_DB1
4029  USE w3sdb1md
4030  USE w3gdatmd, only: sdbsc
4031 #endif
4032 #ifdef W3_BT1
4033  USE w3sbt1md
4034 #endif
4035 #ifdef W3_BT4
4036  USE w3sbt4md
4037 #endif
4038 #ifdef W3_BT8
4039  USE w3sbt8md
4040 #endif
4041 #ifdef W3_BT9
4042  USE w3sbt9md
4043 #endif
4044 #ifdef W3_IC1
4045  USE w3sic1md
4046 #endif
4047 #ifdef W3_IC2
4048  USE w3sic2md
4049 #endif
4050 #ifdef W3_IC3
4051  USE w3sic3md
4052 #endif
4053 #ifdef W3_TR1
4054  USE w3str1md
4055 #endif
4056  INTEGER, INTENT(IN) :: IP
4057  INTEGER, INTENT(INOUT) :: J
4058  REAL, INTENT(in) :: DTG, FACX, FACY, VGX, VGY
4059  REAL, INTENT(out) :: ASPAR_DIAG_LOCAL(NSPEC), B_JAC_LOCAL(NSPEC), ASPAR_OFF_DIAG_LOCAL(NSPEC)
4060  INTEGER :: ISP, ISEA, IP_glob, IPP1, IPP2
4061  INTEGER :: idx, IS, IP1, IP2
4062  INTEGER :: I, ITH, IK, J2
4063  INTEGER :: IE, POS, JSEA
4064  INTEGER :: I1, I2, I3, NI(3), NI_GLOB(3), NI_ISEA(3)
4065  INTEGER :: counter
4066 #ifdef W3_REF1
4067  INTEGER :: eIOBPDR
4068 #endif
4069  REAL :: DTK, TMP3
4070  REAL :: LAMBDA(2)
4071  REAL :: FL11, FL12
4072  REAL :: FL21, FL22
4073  REAL :: FL31, FL32
4074  REAL :: CRFS(3), K(3)
4075  REAL :: KP(3)
4076  REAL :: KM(3), CXY(3,2)
4077  REAL :: K1, eSI, eVS, eVD
4078  REAL :: eVal1, eVal2, eVal3
4079  REAL :: ien_local(6)
4080  REAL :: DELTAL(3)
4081  REAL :: NM
4082  REAL :: TRIA03, SIDT, CCOS, CSIN
4083  REAL :: DEPTH
4084 
4085  aspar_diag_local = 0.d0
4086  b_jac_local = 0.d0
4087  aspar_off_diag_local = 0.d0
4088 
4089  ip_glob=iplg(ip)
4090  DO i = 1, pdlib_ccon(ip)
4091  j = j + 1
4092  ie = pdlib_ie_cell2(i,ip)
4093  ien_local = pdlib_ien(:,ie)
4094  pos = pdlib_pos_cell2(i,ip)
4095  i1 = pdlib_posi(1,j)
4096  i2 = pdlib_posi(2,j)
4097  i3 = pdlib_posi(3,j)
4098  ip1 = ine(pos_trick(pos,1),ie)
4099  ip2 = ine(pos_trick(pos,2),ie)
4100  ipp1 = pos_trick(pos,1)
4101  ipp2 = pos_trick(pos,2)
4102  ni = ine(:,ie)
4103  ni_glob = iplg(ni)
4104  ni_isea = mapfs(1,ni_glob)
4105 
4106  DO isp=1,nspec
4107  ith = 1 + mod(isp-1,nth)
4108  ik = 1 + (isp-1)/nth
4109  ccos = facx * ecos(ith)
4110  csin = facy * esin(ith)
4111  cxy(:,1) = ccos * cg(ik,ni_isea) / clats(ni_isea)
4112  cxy(:,2) = csin * cg(ik,ni_isea)
4113  IF (flcur) THEN
4114  cxy(:,1) = cxy(:,1) + facx * cx(ni_isea)/clats(ni_isea)
4115  cxy(:,2) = cxy(:,2) + facy * cy(ni_isea)
4116  ENDIF
4117 
4118 #ifdef W3_MGP
4119  cxy(:,1) = cxy(:,1) - ccurx*vgx/clats(isea)
4120  cxy(:,2) = cxy(:,2) - ccury*vgy
4121 #endif
4122  fl11 = cxy(2,1)*ien_local(1)+cxy(2,2)*ien_local(2)
4123  fl12 = cxy(3,1)*ien_local(1)+cxy(3,2)*ien_local(2)
4124  fl21 = cxy(3,1)*ien_local(3)+cxy(3,2)*ien_local(4)
4125  fl22 = cxy(1,1)*ien_local(3)+cxy(1,2)*ien_local(4)
4126  fl31 = cxy(1,1)*ien_local(5)+cxy(1,2)*ien_local(6)
4127  fl32 = cxy(2,1)*ien_local(5)+cxy(2,2)*ien_local(6)
4128  crfs(1) = - onesixth * (2.0d0 *fl31 + fl32 + fl21 + 2.0d0 * fl22 )
4129  crfs(2) = - onesixth * (2.0d0 *fl32 + 2.0d0 * fl11 + fl12 + fl31 )
4130  crfs(3) = - onesixth * (2.0d0 *fl12 + 2.0d0 * fl21 + fl22 + fl11 )
4131  lambda(1) = onesixth * sum(cxy(:,1))
4132  lambda(2) = onesixth * sum(cxy(:,2))
4133  k(1) = lambda(1) * ien_local(1) + lambda(2) * ien_local(2)
4134  k(2) = lambda(1) * ien_local(3) + lambda(2) * ien_local(4)
4135  k(3) = lambda(1) * ien_local(5) + lambda(2) * ien_local(6)
4136  kp(:) = max(zero,k(:))
4137  deltal(:) = crfs(:) - kp(:)
4138  km(:) = min(zero,k(:))
4139  nm = 1.d0/min(-thr,sum(km))
4140 #ifdef W3_REF1
4141  eiobpdr=(1-iobp_loc(ip))*(1-iobpd_loc(ith,ip))
4142  IF (eiobpdr .eq. 1) THEN
4143  k1=zero
4144  END IF
4145 #endif
4146  tria03 = onethird * pdlib_tria(ie)
4147  dtk = kp(pos) * dble(dtg) * iobdp_loc(ip) * iobpd_loc(ith,ip) * (1-iobpa_loc(ip))
4148  tmp3 = dtk * nm
4149  IF (fsgeoadvect) THEN
4150  aspar_diag_local(isp) = aspar_diag_local(isp) + tria03 + dtk - tmp3*deltal(pos)
4151  aspar_off_diag_local(isp) = aspar_off_diag_local(isp) - tmp3*deltal(ipp1)*va(isp,ip1)
4152  aspar_off_diag_local(isp) = aspar_off_diag_local(isp) - tmp3*deltal(ipp2)*va(isp,ip2)
4153  ELSE
4154  aspar_diag_local(isp) = aspar_diag_local(isp) + tria03
4155  END IF
4156  b_jac_local(isp) = b_jac_local(isp) + tria03 * vaold(isp,ip) * iobdp_loc(ip) * iobpd_loc(ith,ip)
4157  END DO
4158  END DO
4159  !/
4160  !/ End of W3XYPFSN --------------------------------------------------- /
4161  !/

References w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, fsgeoadvect, w3odatmd::iaproc, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, yowelementpool::ne, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3parall::onesixth, w3parall::onethird, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia, yownodepool::pdlib_ia_p, yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_pos_cell2, yownodepool::pdlib_posi, yownodepool::pdlib_tria, pos_trick, w3gdatmd::sdbsc, w3servmd::strace(), w3parall::thr, w3wdatmd::va, w3wdatmd::vaold, w3adatmd::wn, and w3parall::zero.

◆ calcarray_jacobi4()

subroutine pdlib_w3profsmd::calcarray_jacobi4 ( integer, intent(in)  IP,
real, intent(in)  DTG,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  VGX,
real, intent(in)  VGY,
real, dimension(nspec), intent(out)  ASPAR_DIAG_LOCAL,
real, dimension(nspec), intent(out)  ASPAR_OFF_DIAG_LOCAL,
real, dimension(nspec), intent(out)  B_JAC_LOCAL 
)

Definition at line 4165 of file w3profsmd_pdlib.F90.

4165  !/
4166  !/ +-----------------------------------+
4167  !/ | WAVEWATCH III NOAA/NCEP |
4168  !/ | |
4169  !/ | Aron Roland (BGS IT&E GmbH) |
4170  !/ | Mathieu Dutour-Sikiric (IRB) |
4171  !/ | |
4172  !/ | FORTRAN 90 |
4173  !/ | Last update : 01-June-2018 |
4174  !/ +-----------------------------------+
4175  !/
4176  !/ 01-June-2018 : Origination. ( version 6.04 )
4177  !/
4178  ! 1. Purpose : Compute matrix coefficients for advection part
4179  ! 2. Method :
4180  ! 3. Parameters :
4181  !
4182  ! Parameter list
4183  ! ----------------------------------------------------------------
4184  ! ----------------------------------------------------------------
4185  !
4186  ! 4. Subroutines used :
4187  !
4188  ! Name Type Module Description
4189  ! ----------------------------------------------------------------
4190  ! STRACE Subr. W3SERVMD Subroutine tracing.
4191  ! ----------------------------------------------------------------
4192  !
4193  ! 5. Called by :
4194  !
4195  ! Name Type Module Description
4196  ! ----------------------------------------------------------------
4197  ! ----------------------------------------------------------------
4198  !
4199  ! 6. Error messages :
4200  ! 7. Remarks
4201  ! 8. Structure :
4202  ! 9. Switches :
4203  !
4204  ! !/S Enable subroutine tracing.
4205  !
4206  ! 10. Source code :
4207  !
4208  !/ ------------------------------------------------------------------- /
4209 #ifdef W3_S
4210  USE w3servmd, only: strace
4211 #endif
4212  !
4213  USE w3gdatmd, only: nk, nk2, nth, nspec, fachfa, dmin
4215  USE w3gdatmd, only: nseal,clats
4216  USE w3gdatmd, only: mapsta, nk
4217  USE w3wdatmd, only: va, vaold
4218  USE w3adatmd, only: cg, dw, wn, cx, cy
4219  USE w3idatmd, only: flcur, fllev
4220  USE w3gdatmd, only: ecos, esin, mapfs
4221  USE w3parall, only : onesixth, zero, thr, onethird
4222  use yowelementpool, only: ne, ine
4223  USE yownodepool, only: pdlib_ien, pdlib_tria, &
4227  USE w3odatmd, only : iaproc
4228 #ifdef W3_DB1
4229  USE w3sdb1md
4230  USE w3gdatmd, only: sdbsc
4231 #endif
4232 #ifdef W3_BT1
4233  USE w3sbt1md
4234 #endif
4235 #ifdef W3_BT4
4236  USE w3sbt4md
4237 #endif
4238 #ifdef W3_BT8
4239  USE w3sbt8md
4240 #endif
4241 #ifdef W3_BT9
4242  USE w3sbt9md
4243 #endif
4244 #ifdef W3_IC1
4245  USE w3sic1md
4246 #endif
4247 #ifdef W3_IC2
4248  USE w3sic2md
4249 #endif
4250 #ifdef W3_IC3
4251  USE w3sic3md
4252 #endif
4253 #ifdef W3_TR1
4254  USE w3str1md
4255 #endif
4256  INTEGER, INTENT(IN) :: IP
4257  REAL, INTENT(in) :: DTG, FACX, FACY, VGX, VGY
4258  REAL, INTENT(out) :: ASPAR_DIAG_LOCAL(NSPEC), B_JAC_LOCAL(NSPEC), ASPAR_OFF_DIAG_LOCAL(NSPEC)
4259  !
4260  INTEGER :: IP1, IP2
4261  INTEGER :: ITH, IK
4262  INTEGER :: IE, POS, JSEA
4263  INTEGER :: I, I1, I2, I3, NI(3), NI_GLOB(3), NI_ISEA(3)
4264  INTEGER :: ISP, IP_glob, IPP1, IPP2, IOBPTH1(NTH), IOBPTH2(NTH)
4265  INTEGER :: counter
4266 #ifdef W3_REF1
4267  INTEGER :: eIOBPDR
4268 #endif
4269  REAL :: DTK, TMP3, D1, D2
4270  REAL :: LAMBDA(2)
4271  REAL :: CRFS(3), K(3)
4272  REAL :: KP(3), UV_CUR(3,2)
4273  REAL :: KM(3), CSX(3), CSY(3)
4274  REAL :: K1, eSI, eVS, eVD
4275  REAL :: eVal1, eVal2, eVal3
4276  REAL :: ien_local(6)
4277  REAL :: DELTAL(3), K_X(3,NK), K_Y(3,NK), K_U(3)
4278  REAL :: CRFS_X(3,NK), CRFS_Y(3,NK), CRFS_U(3)
4279  REAL :: NM, CGFAK(3,NK), CSINA(NTH), CCOSA(NTH)
4280  REAL :: TRIA03, SIDT, CCOS, CSIN
4281  REAL :: FL11_X, FL12_X, FL21_X, FL22_X, FL31_X, FL32_X
4282  REAL :: FL11_Y, FL12_Y, FL21_Y, FL22_Y, FL31_Y, FL32_Y
4283  REAL :: FL11_U, FL12_U, FL21_U, FL22_U, FL31_U, FL32_U
4284 
4285  ip_glob = iplg(ip)
4286  aspar_diag_local = zero
4287  b_jac_local = zero
4288  aspar_off_diag_local = zero
4289 
4290  DO ith = 1, nth
4291  ccosa(ith) = facx * ecos(ith)
4292  csina(ith) = facx * esin(ith)
4293  iobpth1(ith) = iobdp_loc(ip) * (1-iobpa_loc(ip)) * iobpd_loc(ith,ip)
4294  iobpth2(ith) = iobdp_loc(ip) * iobpd_loc(ith,ip)
4295  ENDDO
4296 
4297  DO i = 1, pdlib_ccon(ip)
4298 
4299  ie = pdlib_ie_cell2(i,ip)
4300  tria03 = onethird * pdlib_tria(ie)
4301  ien_local = pdlib_ien(1:6,ie)
4302  pos = pdlib_pos_cell2(i,ip)
4303  ip1 = ine(pos_trick(pos,1),ie)
4304  ip2 = ine(pos_trick(pos,2),ie)
4305  ipp1 = pos_trick(pos,1)
4306  ipp2 = pos_trick(pos,2)
4307  ni = ine(1:3,ie)
4308  ni_glob = iplg(ni)
4309  ni_isea = mapfs(1,ni_glob)
4310  crfs_u = zero
4311 
4312  IF (flcur) THEN
4313 
4314  uv_cur(1:3,1) = facx * cx(ni_isea) / clats(ni_isea)
4315  uv_cur(1:3,2) = facy * cy(ni_isea)
4316 
4317  lambda(1) = onesixth*(uv_cur(1,1)+uv_cur(2,1)+uv_cur(3,1))
4318  lambda(2) = onesixth*(uv_cur(1,2)+uv_cur(2,2)+uv_cur(3,2))
4319 
4320  k_u(1) = lambda(1) * ien_local(1) + lambda(2) * ien_local(2)
4321  k_u(2) = lambda(1) * ien_local(3) + lambda(2) * ien_local(4)
4322  k_u(3) = lambda(1) * ien_local(5) + lambda(2) * ien_local(6)
4323 
4324  fl11_u = uv_cur(2,1)*ien_local(1)+uv_cur(2,2)*ien_local(2)
4325  fl12_u = uv_cur(3,1)*ien_local(1)+uv_cur(3,2)*ien_local(2)
4326  fl21_u = uv_cur(3,1)*ien_local(3)+uv_cur(3,2)*ien_local(4)
4327  fl22_u = uv_cur(1,1)*ien_local(3)+uv_cur(1,2)*ien_local(4)
4328  fl31_u = uv_cur(1,1)*ien_local(5)+uv_cur(1,2)*ien_local(6)
4329  fl32_u = uv_cur(2,1)*ien_local(5)+uv_cur(2,2)*ien_local(6)
4330 
4331  crfs_u(1) = - onesixth*(2.d0 *fl31_u + fl32_u + fl21_u + 2.d0 * fl22_u)
4332  crfs_u(2) = - onesixth*(2.d0 *fl32_u + 2.d0 * fl11_u + fl12_u + fl31_u)
4333  crfs_u(3) = - onesixth*(2.d0 *fl12_u + 2.d0 * fl21_u + fl22_u + fl11_u)
4334 
4335  ENDIF
4336 
4337  DO ik = 1, nk
4338  csx = cg(ik,ni_isea) / clats(ni_isea)
4339  csy = cg(ik,ni_isea)
4340  lambda(1) = onesixth * (csx(1) + csx(2) + csx(3))
4341  lambda(2) = onesixth * (csy(1) + csy(2) + csy(3))
4342  k_x(1,ik) = lambda(1) * ien_local(1)
4343  k_x(2,ik) = lambda(1) * ien_local(3)
4344  k_x(3,ik) = lambda(1) * ien_local(5)
4345  k_y(1,ik) = lambda(2) * ien_local(2)
4346  k_y(2,ik) = lambda(2) * ien_local(4)
4347  k_y(3,ik) = lambda(2) * ien_local(6)
4348  fl11_x = csx(2) * ien_local(1)
4349  fl12_x = csx(3) * ien_local(1)
4350  fl21_x = csx(3) * ien_local(3)
4351  fl22_x = csx(1) * ien_local(3)
4352  fl31_x = csx(1) * ien_local(5)
4353  fl32_x = csx(2) * ien_local(5)
4354  fl11_y = csy(2) * ien_local(2)
4355  fl12_y = csy(3) * ien_local(2)
4356  fl21_y = csy(3) * ien_local(4)
4357  fl22_y = csy(1) * ien_local(4)
4358  fl31_y = csy(1) * ien_local(6)
4359  fl32_y = csy(2) * ien_local(6)
4360  crfs_x(1,ik) = - onesixth*(2.d0*fl31_x + fl32_x + fl21_x + 2.d0 * fl22_x)
4361  crfs_x(2,ik) = - onesixth*(2.d0*fl32_x + 2.d0 * fl11_x + fl12_x + fl31_x)
4362  crfs_x(3,ik) = - onesixth*(2.d0*fl12_x + 2.d0 * fl21_x + fl22_x + fl11_x)
4363  crfs_y(1,ik) = - onesixth*(2.d0*fl31_y + fl32_y + fl21_y + 2.d0 * fl22_y)
4364  crfs_y(2,ik) = - onesixth*(2.d0*fl32_y + 2.d0 * fl11_y + fl12_y + fl31_y)
4365  crfs_y(3,ik) = - onesixth*(2.d0*fl12_y + 2.d0 * fl21_y + fl22_y + fl11_y)
4366  ENDDO
4367 
4368  DO isp = 1, nspec
4369  ith = 1 + mod(isp-1,nth)
4370  ik = 1 + (isp-1)/nth
4371  k(1) = k_x(1,ik) * ccosa(ith) + k_y(1,ik) * csina(ith) + k_u(1)
4372  k(2) = k_x(2,ik) * ccosa(ith) + k_y(2,ik) * csina(ith) + k_u(2)
4373  k(3) = k_x(3,ik) * ccosa(ith) + k_y(3,ik) * csina(ith) + k_u(3)
4374  crfs(1) = crfs_x(1,ik) * ccosa(ith) + crfs_y(1,ik) * csina(ith) + crfs_u(1)
4375  crfs(2) = crfs_x(2,ik) * ccosa(ith) + crfs_y(2,ik) * csina(ith) + crfs_u(2)
4376  crfs(3) = crfs_x(3,ik) * ccosa(ith) + crfs_y(3,ik) * csina(ith) + crfs_u(3)
4377  !KM = MIN(ZERO,K)
4378  kp(1:3) = max(zero,k(1:3))
4379  deltal(1:3) = crfs(1:3) - kp(1:3)
4380  !NM = 1.d0/MIN(-THR,SUM(MIN(ZERO,K)))
4381  dtk = kp(pos) * dtg * iobpth1(ith)!IOBDP(IP_glob) * (1-IOBPA(IP_glob)) * IOBPD(ITH,IP_glob)
4382  tmp3 = dtk * 1.d0/min(-thr,sum(min(zero,k(1:3))))
4383  IF (fsgeoadvect) THEN
4384  aspar_diag_local(isp) = aspar_diag_local(isp) + tria03 + dtk - tmp3*deltal(pos)
4385  d1 = deltal(ipp1)*va(isp,ip1)
4386  d2 = deltal(ipp2)*va(isp,ip2)
4387  aspar_off_diag_local(isp) = aspar_off_diag_local(isp) - ( tmp3 * ( d1 + d2 ) )
4388  !ASPAR_OFF_DIAG_LOCAL(ISP) = ASPAR_OFF_DIAG_LOCAL(ISP) - D2
4389  ELSE
4390  aspar_diag_local(isp) = aspar_diag_local(isp) + tria03
4391  END IF
4392  b_jac_local(isp) = b_jac_local(isp) + tria03 * vaold(isp,ip) * iobpth2(ith)!IOBDP(IP_glob) * IOBPD(ITH,IP_glob)
4393  END DO
4394  END DO

References w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, fsgeoadvect, w3odatmd::iaproc, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, yowelementpool::ne, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3parall::onesixth, w3parall::onethird, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia, yownodepool::pdlib_ia_p, yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_pos_cell2, yownodepool::pdlib_posi, yownodepool::pdlib_tria, pos_trick, w3gdatmd::sdbsc, w3servmd::strace(), w3parall::thr, w3wdatmd::va, w3wdatmd::vaold, w3adatmd::wn, and w3parall::zero.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ calcarray_jacobi_source_1()

subroutine pdlib_w3profsmd::calcarray_jacobi_source_1 ( real, intent(in)  DTG)

Definition at line 4702 of file w3profsmd_pdlib.F90.

4702  !/
4703  !/ +-----------------------------------+
4704  !/ | WAVEWATCH III NOAA/NCEP |
4705  !/ | |
4706  !/ | Aron Roland (BGS IT&E GmbH) |
4707  !/ | Mathieu Dutour-Sikiric (IRB) |
4708  !/ | |
4709  !/ | FORTRAN 90 |
4710  !/ | Last update : 01-June-2018 |
4711  !/ +-----------------------------------+
4712  !/
4713  !/ 01-June-2018 : Origination. ( version 6.04 )
4714  !/
4715  ! 1. Purpose : Compute matrix coefficients for source part
4716  ! 2. Method :
4717  ! 3. Parameters :
4718  !
4719  ! Parameter list
4720  ! ----------------------------------------------------------------
4721  ! ----------------------------------------------------------------
4722  !
4723  ! 4. Subroutines used :
4724  !
4725  ! Name Type Module Description
4726  ! ----------------------------------------------------------------
4727  ! STRACE Subr. W3SERVMD Subroutine tracing.
4728  ! ----------------------------------------------------------------
4729  !
4730  ! 5. Called by :
4731  !
4732  ! Name Type Module Description
4733  ! ----------------------------------------------------------------
4734  ! ----------------------------------------------------------------
4735  !
4736  ! 6. Error messages :
4737  ! 7. Remarks
4738  ! 8. Structure :
4739  ! 9. Switches :
4740  !
4741  ! !/S Enable subroutine tracing.
4742  !
4743  ! 10. Source code :
4744  !
4745  !/ ------------------------------------------------------------------- /
4746 #ifdef W3_S
4747  USE w3servmd, only: strace
4748 #endif
4749  !
4750  USE w3odatmd, only : iaproc
4751  USE yownodepool, only: iplg, pdlib_si, pdlib_i_diag, npa, np
4752  USE w3adatmd, only: cg, dw, wn
4753  USE w3wdatmd, only: ust, ustdir
4754  USE w3gdatmd, only: nk, nth, nspec, mapfs, optioncall, dmin
4755  USE w3gdatmd, only: mapsta, facp, sig
4757  USE w3parall, only: imem
4758  USE w3gdatmd, only: nseal, clats
4759 #ifdef W3_DB1
4760  USE w3sdb1md
4761  USE w3gdatmd, only: sdbsc
4762 #endif
4763 #ifdef W3_DB2
4764  USE w3sdb2md
4765 #endif
4766  USE w3wdatmd, only: va, vstot, vdtot, shavetot
4767  USE constants, only : tpi, tpiinv, grav
4768 
4769  REAL, INTENT(in) :: DTG
4770  REAL, PARAMETER :: COEF4 = 5.0e-07
4771  REAL, PARAMETER :: FACDAM = 1
4772  INTEGER JSEA, IP, IP_glob, ISEA
4773  INTEGER IK, ITH, ISP, IS0
4774  LOGICAL :: LBREAK
4775  REAL :: eSI, eVS, eVD, SIDT
4776  REAL :: DEPTH, DAM(NSPEC), RATIO, MAXDAC, VSDB(NSPEC), VDDB(NSPEC)
4777  REAL :: PreVS, eDam, DVS, FREQ, EMEAN, FMEAN, WNMEAN, AMAX, CG1(NK),WN1(NK),SPEC_VA(NSPEC)
4778  REAL TheFactor
4779 
4780  DO jsea = 1, np
4781 
4782  ip = jsea
4783  ip_glob = iplg(ip)
4784  isea = mapfs(1,ip_glob)
4785 
4786  IF ((iobp_loc(ip).eq.1..or.iobp_loc(jsea).eq. 3).and.iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4787 
4788  DO ik=1, nk
4789  dam(1+(ik-1)*nth) = facp / ( sig(ik) * wn(ik,isea)**3 )
4790  END DO
4791  DO ik=1, nk
4792  is0 = (ik-1)*nth
4793  DO ith=2, nth
4794  dam(ith+is0) = dam(1+is0)
4795  END DO
4796  END DO
4797 
4798  esi = pdlib_si(ip)
4799  sidt = esi * dtg
4800  depth = dw(isea)
4801 #ifdef W3_DB1
4802  vsdb = 0.
4803  vddb = 0.
4804  cg1 = cg(1:nk,isea)
4805  wn1 = wn(1:nk,isea)
4806  DO ik=1,nk
4807  DO ith=1,nth
4808  isp=ith + (ik-1)*nth
4809  spec_va(isp) = va(isp,jsea) * cg(ik,isea) / clats(isea)
4810  ENDDO
4811  ENDDO
4812  CALL compute_mean_param(spec_va, cg1, wn1, emean, fmean, wnmean, amax)
4813  SELECT CASE (nint(sdbsc))
4814  CASE(1)
4815  CALL w3sdb1 ( jsea, spec_va, depth, emean, fmean, wnmean, cg1, lbreak, vsdb, vddb )
4816  CASE(2)
4817  !CALL W3SDB2 ( JSEA, SPEC_VA, DEPTH, EMEAN, FMEAN, CG1, LBREAK, VSDB, VDDB )
4818  END SELECT
4819 #endif
4820 #ifdef W3_DB2
4821  vsdb = 0.
4822  vddb = 0.
4823  cg1 = cg(1:nk,isea)
4824  wn1 = wn(1:nk,isea)
4825  DO ik=1,nk
4826  DO ith=1,nth
4827  isp=ith + (ik-1)*nth
4828  spec_va(isp) = va(isp,jsea) * cg(ik,isea) / clats(isea)
4829  ENDDO
4830  ENDDO
4831  CALL compute_mean_param(spec_va, cg1, wn1, emean, fmean, wnmean, amax)
4832  CALL w3sdb2 ( jsea, spec_va, depth, emean, fmean, cg1, lbreak, vsdb, vddb )
4833 #endif
4834  DO ik=1,nk
4835  DO ith=1,nth
4836  isp=ith + (ik-1)*nth
4837  IF (shavetot(jsea)) THEN ! Limit only the source term part ...
4838  maxdac = facdam * dam(isp)
4839  thefactor = dtg / max( 1. , (1.-dtg*vdtot(isp,jsea)))
4840  dvs = vstot(isp,jsea) * thefactor
4841  dvs = sign(min(maxdac,abs(dvs)),dvs)
4842  prevs = dvs / thefactor
4843  ELSE
4844  prevs = vstot(isp,jsea)
4845  END IF
4846  evs = prevs * clats(isea) / cg(ik,isea)
4847  evd = dble(vdtot(isp,jsea))
4848 #ifdef W3_DB1
4849  evs = evs + dble(vsdb(isp)) / cg(ik,isea) * clats(isea)
4850  evd = evd + dble(vddb(isp))
4851 #endif
4852 #ifdef W3_DB2
4853  evs = evs + dble(vsdb(isp)) / cg(ik,isea) * clats(isea)
4854  evd = evd + dble(vddb(isp))
4855 #endif
4856  b_jac(isp,ip) = b_jac(isp,ip) + sidt * (evs - evd*va(isp,jsea))
4857  aspar_jac(isp,pdlib_i_diag(ip)) = aspar_jac(isp,pdlib_i_diag(ip)) - sidt * evd
4858  END DO
4859  END DO
4860  END IF
4861  END DO

References aspar_jac, b_jac, w3adatmd::cg, w3gdatmd::clats, compute_mean_param(), w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::facp, constants::grav, w3odatmd::iaproc, w3parall::imem, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::optioncall, yownodepool::pdlib_i_diag, yownodepool::pdlib_si, w3gdatmd::sdbsc, w3wdatmd::shavetot, w3gdatmd::sig, w3servmd::strace(), constants::tpi, constants::tpiinv, w3wdatmd::ust, w3wdatmd::ustdir, w3wdatmd::va, w3wdatmd::vdtot, w3wdatmd::vstot, w3sdb1md::w3sdb1(), and w3adatmd::wn.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ calcarray_jacobi_source_2()

subroutine pdlib_w3profsmd::calcarray_jacobi_source_2 ( real, intent(in)  DTG,
real, dimension(:,:), intent(inout)  ASPAR_DIAG_LOCAL 
)

Definition at line 4865 of file w3profsmd_pdlib.F90.

4865  !/
4866  !/ +-----------------------------------+
4867  !/ | WAVEWATCH III NOAA/NCEP |
4868  !/ | |
4869  !/ | Aron Roland (BGS IT&E GmbH) |
4870  !/ | Mathieu Dutour-Sikiric (IRB) |
4871  !/ | |
4872  !/ | FORTRAN 90 |
4873  !/ | Last update : 01-June-2018 |
4874  !/ +-----------------------------------+
4875  !/
4876  !/ 01-June-2018 : Origination. ( version 6.04 )
4877  !/
4878  ! 1. Purpose : Compute matrix coefficients for source part
4879  ! 2. Method :
4880  ! 3. Parameters :
4881  !
4882  ! Parameter list
4883  ! ----------------------------------------------------------------
4884  ! ----------------------------------------------------------------
4885  !
4886  ! 4. Subroutines used :
4887  !
4888  ! Name Type Module Description
4889  ! ----------------------------------------------------------------
4890  ! STRACE Subr. W3SERVMD Subroutine tracing.
4891  ! ----------------------------------------------------------------
4892  !
4893  ! 5. Called by :
4894  !
4895  ! Name Type Module Description
4896  ! ----------------------------------------------------------------
4897  ! ----------------------------------------------------------------
4898  !
4899  ! 6. Error messages :
4900  ! 7. Remarks
4901  ! 8. Structure :
4902  ! 9. Switches :
4903  !
4904  ! !/S Enable subroutine tracing.
4905  !
4906  ! 10. Source code :
4907  !
4908  !/ ------------------------------------------------------------------- /
4909 #ifdef W3_S
4910  USE w3servmd, only: strace
4911 #endif
4912  !
4913  USE w3odatmd, only : iaproc
4914  USE yownodepool, only: iplg, pdlib_si, pdlib_i_diag, npa, np
4915  USE w3adatmd, only: cg, dw, wn
4916  USE w3wdatmd, only: ust, ustdir
4917  USE w3gdatmd, only: nk, nth, nspec, mapfs, optioncall, dmin
4918  USE w3gdatmd, only: iobp, mapsta, facp, sig, iobpd, iobpa, iobdp
4919  USE w3parall, only: imem
4920  USE w3gdatmd, only: nseal, clats
4921 #ifdef W3_DB1
4922  USE w3sdb1md
4923  USE w3gdatmd, only: sdbsc
4924 #endif
4925 #ifdef W3_DB2
4926  USE w3sdb2md
4927 #endif
4928  USE w3wdatmd, only: va, vstot, vdtot, shavetot
4929  USE constants, only : tpi, tpiinv, grav
4930 
4931  REAL, INTENT(in) :: DTG
4932  REAL, INTENT(inout) :: ASPAR_DIAG_LOCAL(:,:)
4933  REAL, PARAMETER :: COEF4 = 5.0e-07
4934  REAL, PARAMETER :: FACDAM = 1
4935  INTEGER JSEA, IP, IP_glob, ISEA
4936  INTEGER IK, ITH, ISP, IS0
4937  LOGICAL :: LBREAK
4938  REAL :: eSI, eVS, eVD, SIDT
4939  REAL :: DEPTH, DAM(NSPEC), RATIO, MAXDAC, VSDB(NSPEC), VDDB(NSPEC)
4940  REAL :: PreVS, eDam, DVS, FREQ, EMEAN, FMEAN, WNMEAN, AMAX, CG1(NK),WN1(NK),SPEC_VA(NSPEC)
4941  REAL TheFactor
4942 
4943  DO jsea = 1, np
4944 
4945  ip = jsea
4946  ip_glob = iplg(ip)
4947  isea = mapfs(1,ip_glob)
4948 
4949  IF (iobp(ip_glob).eq.1..and.iobdp(ip_glob).eq.1.and.iobpa(ip_glob).eq.0) THEN
4950  DO ik=1, nk
4951  dam(1+(ik-1)*nth) = facp / ( sig(ik) * wn(ik,isea)**3 )
4952  END DO
4953  DO ik=1, nk
4954  is0 = (ik-1)*nth
4955  DO ith=2, nth
4956  dam(ith+is0) = dam(1+is0)
4957  END DO
4958  END DO
4959  esi = pdlib_si(ip)
4960  sidt = esi * dtg
4961  depth = dw(isea)
4962 #ifdef W3_DB1
4963  vsdb = 0.
4964  vddb = 0.
4965  cg1 = cg(1:nk,isea)
4966  wn1 = wn(1:nk,isea)
4967  DO ik=1,nk
4968  DO ith=1,nth
4969  isp=ith + (ik-1)*nth
4970  spec_va(isp) = va(isp,jsea) * cg(ik,isea) / clats(isea)
4971  ENDDO
4972  ENDDO
4973  CALL compute_mean_param(spec_va, cg1, wn1, emean, fmean, wnmean, amax)
4974  SELECT CASE (nint(sdbsc))
4975  CASE(1)
4976  CALL w3sdb1 ( jsea, spec_va, depth, emean, fmean, wnmean, cg1, lbreak, vsdb, vddb )
4977  CASE(2)
4978  !CALL W3SDB2 ( JSEA, SPEC_VA, DEPTH, EMEAN, FMEAN, CG1, LBREAK, VSDB, VDDB )
4979  END SELECT
4980 #endif
4981 #ifdef W3_DB2
4982  vsdb = 0.
4983  vddb = 0.
4984  cg1 = cg(1:nk,isea)
4985  wn1 = wn(1:nk,isea)
4986  DO ik=1,nk
4987  DO ith=1,nth
4988  isp=ith + (ik-1)*nth
4989  spec_va(isp) = va(isp,jsea) * cg(ik,isea) / clats(isea)
4990  ENDDO
4991  ENDDO
4992  CALL compute_mean_param(spec_va, cg1, wn1, emean, fmean, wnmean, amax)
4993  CALL w3sdb2 ( jsea, spec_va, depth, emean, fmean, cg1, lbreak, vsdb, vddb )
4994 #endif
4995  DO ik=1,nk
4996  DO ith=1,nth
4997  isp=ith + (ik-1)*nth
4998  IF (shavetot(jsea)) THEN ! Limit only the source term part ...
4999  maxdac = facdam * dam(isp)
5000  thefactor = dtg / max( 1. , (1.-dtg*vdtot(isp,jsea)))
5001  dvs = vstot(isp,jsea) * thefactor
5002  dvs = sign(min(maxdac,abs(dvs)),dvs)
5003  prevs = dvs / thefactor
5004  ELSE
5005  prevs = vstot(isp,jsea)
5006  END IF
5007  evs = prevs / cg(ik,isea) * clats(isea)
5008  evd = dble(vdtot(isp,jsea))
5009 #ifdef W3_DB1
5010  evs = evs + dble(vsdb(isp)) / cg(ik,isea) * clats(isea)
5011  evd = evd + dble(vddb(isp))
5012 #endif
5013 #ifdef W3_DB2
5014  evs = evs + dble(vsdb(isp)) / cg(ik,isea) * clats(isea)
5015  evd = evd + dble(vddb(isp))
5016 #endif
5017  b_jac(isp,ip) = b_jac(isp,ip) + sidt * (evs - evd*va(isp,jsea))
5018  aspar_diag_local(isp,ip) = aspar_diag_local(isp,ip) - sidt * evd
5019  END DO
5020  END DO
5021  END IF
5022  END DO

References b_jac, w3adatmd::cg, w3gdatmd::clats, compute_mean_param(), w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::facp, constants::grav, w3odatmd::iaproc, w3parall::imem, w3gdatmd::iobdp, w3gdatmd::iobp, w3gdatmd::iobpa, w3gdatmd::iobpd, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::optioncall, yownodepool::pdlib_i_diag, yownodepool::pdlib_si, w3gdatmd::sdbsc, w3wdatmd::shavetot, w3gdatmd::sig, w3servmd::strace(), constants::tpi, constants::tpiinv, w3wdatmd::ust, w3wdatmd::ustdir, w3wdatmd::va, w3wdatmd::vdtot, w3wdatmd::vstot, w3sdb1md::w3sdb1(), and w3adatmd::wn.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ calcarray_jacobi_spectral_1()

subroutine pdlib_w3profsmd::calcarray_jacobi_spectral_1 ( real, intent(in)  DTG)

Definition at line 4398 of file w3profsmd_pdlib.F90.

4398  !/
4399  !/ +-----------------------------------+
4400  !/ | WAVEWATCH III NOAA/NCEP |
4401  !/ | |
4402  !/ | Aron Roland (BGS IT&E GmbH) |
4403  !/ | Mathieu Dutour-Sikiric (IRB) |
4404  !/ | |
4405  !/ | FORTRAN 90 |
4406  !/ | Last update : 01-June-2018 |
4407  !/ +-----------------------------------+
4408  !/
4409  !/ 01-June-2018 : Origination. ( version 6.04 )
4410  !/
4411  ! 1. Purpose : Compute matrix coefficients for spectral part
4412  ! 2. Method :
4413  ! 3. Parameters :
4414  !
4415  ! Parameter list
4416  ! ----------------------------------------------------------------
4417  ! ----------------------------------------------------------------
4418  !
4419  ! 4. Subroutines used :
4420  !
4421  ! Name Type Module Description
4422  ! ----------------------------------------------------------------
4423  ! STRACE Subr. W3SERVMD Subroutine tracing.
4424  ! ----------------------------------------------------------------
4425  !
4426  ! 5. Called by :
4427  !
4428  ! Name Type Module Description
4429  ! ----------------------------------------------------------------
4430  ! ----------------------------------------------------------------
4431  !
4432  ! 6. Error messages :
4433  ! 7. Remarks
4434  ! 8. Structure :
4435  ! 9. Switches :
4436  !
4437  ! !/S Enable subroutine tracing.
4438  !
4439  ! 10. Source code :
4440  !
4441  !/ ------------------------------------------------------------------- /
4442 #ifdef W3_S
4443  USE w3servmd, only: strace
4444 #endif
4445  !
4447  USE w3odatmd, only : iaproc
4448  USE yownodepool, only: np, iplg, pdlib_si, pdlib_i_diag
4450  USE w3idatmd, only: fllev, flcur
4451  USE w3gdatmd, only: nk, nk2, nth, nspec, mapfs, dmin, dsip, nseal
4453  USE w3adatmd, only: cg, dw
4454 
4455  REAL, INTENT(in) :: DTG
4456  INTEGER IP, IP_glob, ITH, IK
4457  INTEGER ISEA, ISP
4458  REAL :: eSI
4459  REAL :: B_SIG(NSPEC), B_THE(NSPEC)
4460  REAL :: CP_SIG(NSPEC), CM_SIG(NSPEC)
4461  REAL :: CP_THE(NSPEC), CM_THE(NSPEC)
4462  REAL :: CAD(NSPEC), CAS(NSPEC)
4463  REAL :: DMM(0:NK2), eVal
4464  REAL :: DWNI_M2(NK), CWNB_M2(1-NTH:NSPEC)
4465  LOGICAL :: DoLimiterRefraction = .false.
4466  LOGICAL :: DoLimiterFreqShit = .false. !AR: This one is missing ...
4467  INTEGER :: ITH0
4468 
4469  LOGICAL :: LSIG = .false.
4470  !AR: TODO: check&report if needed ...
4471  lsig = flcur .OR. fllev
4472 
4473  DO ip = 1, np
4474  ip_glob=iplg(ip)
4475  isea=mapfs(1,ip_glob)
4476  esi=pdlib_si(ip)
4477  IF (fsfreqshift .AND. lsig) THEN
4478  IF (freqshiftmethod .eq. 1) THEN
4479  IF (iobp_loc(ip).eq.1.and.iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4480  CALL prop_freq_shift(ip, isea, cas, dmm, dtg)
4481  cp_sig = max(zero,cas)
4482  cm_sig = min(zero,cas)
4483  b_sig=0
4484  DO ith=1,nth
4485  DO ik=1,nk
4486  isp=ith + (ik-1)*nth
4487  b_sig(isp)= cp_sig(isp)/dmm(ik-1) - cm_sig(isp)/dmm(ik)
4488  END DO
4489  isp = ith + (nk-1)*nth
4490  b_sig(isp)= b_sig(isp) + cm_sig(isp)/dmm(nk) * fachfa
4491  END DO
4492  aspar_jac(:,pdlib_i_diag(ip))=aspar_jac(:,pdlib_i_diag(ip)) + b_sig(:)*esi
4493  ELSE
4494  cas=0
4495  END IF
4496  cas_sig(:,ip) = cas
4497  ELSE IF (freqshiftmethod .eq. 2) THEN
4498  IF (iobp_loc(ip).eq.1.and.iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4499  CALL prop_freq_shift_m2(ip, isea, cwnb_m2, dwni_m2, dtg)
4500 #ifdef W3_DEBUGFREQSHIFT
4501  WRITE(740+iaproc,*) 'sum(CWNB_M2)=', sum(cwnb_m2)
4502 #endif
4503  DO ith=1,nth
4504  DO ik=1,nk
4505  isp = ith + (ik-1)*nth
4506  eval = dwni_m2(ik) * ( min(cwnb_m2(isp - nth), zero) - max(cwnb_m2(isp),zero) )
4507  aspar_jac(isp,pdlib_i_diag(ip)) = aspar_jac(isp,pdlib_i_diag(ip)) - esi * eval
4508  END DO
4509  eval = dwni_m2(nk) * min(cwnb_m2(ith + (nk-1)*nth), zero) * fachfa
4510  ith0 = nspec - nth
4511  aspar_jac(ith0 + ith,pdlib_i_diag(ip)) = aspar_jac(ith0 + ith,pdlib_i_diag(ip)) + esi * eval
4512  END DO
4513  ELSE
4514  cwnb_m2 = 0
4515  END IF
4516  cwnb_sig_m2(:,ip)=cwnb_m2
4517  END IF
4518  END IF
4519  !
4520  ! The refraction
4521  !
4522  IF (fsrefraction) THEN
4523  IF (iobp_loc(ip) .eq. 1 .and. iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4524  ! CALL PROP_REFRACTION_PR1(ISEA,DTG,CAD) !AR: Check statuts ...
4525  ! CALL PROP_REFRACTION_PR3(ISEA,DTG,CAD, DoLimiterRefraction)
4526  CALL prop_refraction_pr3(ip,isea,dtg,cad,dolimiterrefraction)
4527  ELSE
4528  cad=zero
4529  END IF
4530 #ifdef W3_DEBUGREFRACTION
4531  WRITE(740+iaproc,*) 'refraction IP=', ip, ' ISEA=', isea
4532  WRITE(740+iaproc,*) 'sum(abs(CAD))=', sum(abs(cad))
4533 #endif
4534  cad_the(:,ip)=cad
4535  cp_the = dtg*max(zero,cad)
4536  cm_the = dtg*min(zero,cad)
4537  b_the(:) = cp_the(:) - cm_the(:)
4538  aspar_jac(:,pdlib_i_diag(ip))=aspar_jac(:,pdlib_i_diag(ip)) + b_the(:)*esi
4539  END IF
4540  END DO

References aspar_jac, cad_the, cas_sig, w3adatmd::cg, cwnb_sig_m2, w3gdatmd::dmin, w3gdatmd::dsip, w3adatmd::dw, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, freqshiftmethod, w3gdatmd::fsfreqshift, w3gdatmd::fsrefraction, w3odatmd::iaproc, w3parall::imem, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, yownodepool::pdlib_i_diag, yownodepool::pdlib_si, w3parall::prop_freq_shift(), w3parall::prop_freq_shift_m2(), w3parall::prop_refraction_pr1(), w3parall::prop_refraction_pr3(), w3servmd::strace(), and w3parall::zero.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ calcarray_jacobi_spectral_2()

subroutine pdlib_w3profsmd::calcarray_jacobi_spectral_2 ( real, intent(in)  DTG,
real, dimension(nspec,nseal), intent(inout)  ASPAR_DIAG_LOCAL 
)

Definition at line 4544 of file w3profsmd_pdlib.F90.

4544  !/
4545  !/ +-----------------------------------+
4546  !/ | WAVEWATCH III NOAA/NCEP |
4547  !/ | |
4548  !/ | Aron Roland (BGS IT&E GmbH) |
4549  !/ | Mathieu Dutour-Sikiric (IRB) |
4550  !/ | |
4551  !/ | FORTRAN 90 |
4552  !/ | Last update : 01-June-2018 |
4553  !/ +-----------------------------------+
4554  !/
4555  !/ 01-June-2018 : Origination. ( version 6.04 )
4556  !/
4557  ! 1. Purpose : Compute matrix coefficients for spectral part
4558  ! 2. Method :
4559  ! 3. Parameters :
4560  !
4561  ! Parameter list
4562  ! ----------------------------------------------------------------
4563  ! ----------------------------------------------------------------
4564  !
4565  ! 4. Subroutines used :
4566  !
4567  ! Name Type Module Description
4568  ! ----------------------------------------------------------------
4569  ! STRACE Subr. W3SERVMD Subroutine tracing.
4570  ! ----------------------------------------------------------------
4571  !
4572  ! 5. Called by :
4573  !
4574  ! Name Type Module Description
4575  ! ----------------------------------------------------------------
4576  ! ----------------------------------------------------------------
4577  !
4578  ! 6. Error messages :
4579  ! 7. Remarks
4580  ! 8. Structure :
4581  ! 9. Switches :
4582  !
4583  ! !/S Enable subroutine tracing.
4584  !
4585  ! 10. Source code :
4586  !
4587  !/ ------------------------------------------------------------------- /
4588 
4589  !
4590  !/ ------------------------------------------------------------------- /
4591 #ifdef W3_S
4592  USE w3servmd, only: strace
4593 #endif
4594  !
4596  USE w3odatmd, only : iaproc
4597  USE yownodepool, only: np, iplg, pdlib_si, pdlib_i_diag
4599  USE w3idatmd, only: fllev, flcur
4600  USE w3gdatmd, only: nk, nk2, nth, nspec, mapfs, dmin, dsip, nseal, mapsta
4602  USE w3adatmd, only: cg, dw
4603 
4604  REAL, INTENT(in) :: DTG
4605  REAL, INTENT(inout) :: ASPAR_DIAG_LOCAL(nspec,NSEAL)
4606  INTEGER IP, IP_glob, ITH, IK
4607  INTEGER ISEA, ISP
4608  REAL :: eSI
4609  REAL :: B_SIG(NSPEC), B_THE(NSPEC)
4610  REAL :: CP_SIG(NSPEC), CM_SIG(NSPEC)
4611  REAL :: CP_THE(NSPEC), CM_THE(NSPEC)
4612  REAL :: CAD(NSPEC), CAS(NSPEC)
4613  REAL :: DMM(0:NK2), eVal
4614  REAL :: DWNI_M2(NK), CWNB_M2(1-NTH:NSPEC)
4615  LOGICAL :: DoLimiterRefraction = .false.
4616  LOGICAL :: DoLimiterFreqShit = .false. !AR: This one is missing ...
4617  INTEGER :: ITH0
4618 
4619  LOGICAL :: LSIG = .false.
4620  lsig = flcur .OR. fllev
4621 
4622  DO ip = 1, np
4623 
4624  ip_glob=iplg(ip)
4625  isea=mapfs(1,ip_glob)
4626  esi=pdlib_si(ip)
4627  !
4628  ! The frequency shifting
4629  !
4630  IF (fsfreqshift .AND. lsig) THEN
4631  IF (freqshiftmethod .eq. 1) THEN
4632  IF (iobp_loc(ip).eq.1.and.iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4633  CALL prop_freq_shift(ip, isea, cas, dmm, dtg)
4634  cp_sig = max(zero,cas)
4635  cm_sig = min(zero,cas)
4636  b_sig=0
4637  DO ith=1,nth
4638  DO ik=1,nk
4639  isp=ith + (ik-1)*nth
4640  b_sig(isp)= cp_sig(isp)/dmm(ik-1) - cm_sig(isp)/dmm(ik)
4641  END DO
4642  isp = ith + (nk-1)*nth
4643  b_sig(isp)= b_sig(isp) + cm_sig(isp)/dmm(nk) * fachfa
4644  END DO
4645  aspar_diag_local(:,ip) = aspar_diag_local(:,ip) + b_sig * esi
4646  ELSE
4647  cas = 0
4648  END IF
4649  cas_sig(:,ip) = cas
4650  END IF
4651 
4652  IF (freqshiftmethod .eq. 2) THEN
4653  IF (iobp_loc(ip).eq.1) THEN
4654  CALL prop_freq_shift_m2(ip, isea, cwnb_m2, dwni_m2, dtg)
4655 #ifdef W3_DEBUGFREQSHIFT
4656  WRITE(740+iaproc,*) 'sum(CWNB_M2)=', sum(cwnb_m2)
4657 #endif
4658  DO ith=1,nth
4659  DO ik=1,nk
4660  isp = ith + (ik-1)*nth
4661  eval = dwni_m2(ik) * ( min(cwnb_m2(isp - nth), zero) - max(cwnb_m2(isp),zero) )
4662  IF (imem == 1) THEN
4663  aspar_jac(isp,pdlib_i_diag(ip)) = aspar_jac(isp,pdlib_i_diag(ip)) - esi * eval
4664  ELSE IF (imem == 2) THEN
4665  aspar_diag_local(isp,ip) = aspar_diag_local(isp,ip) - esi * eval
4666  ENDIF
4667  END DO
4668  eval = dwni_m2(nk) * min(cwnb_m2(ith + (nk-1)*nth), zero) * fachfa
4669  ith0 = nspec - nth
4670  aspar_diag_local(ith0 + ith,ip) = aspar_diag_local(ith0 + ith,ip) + esi * eval
4671  END DO
4672  ELSE
4673  cwnb_m2=0
4674  END IF
4675  cwnb_sig_m2(:,ip)=cwnb_m2
4676  END IF
4677  END IF
4678  !
4679  IF (fsrefraction) THEN
4680  IF (iobp_loc(ip) .eq. 1.and.iobdp_loc(ip).eq.1.and.iobpa_loc(ip).eq.0) THEN
4681  ! CALL PROP_REFRACTION_PR1(ISEA,DTG,CAD) !AR: Is this working?
4682  ! CALL PROP_REFRACTION_PR3(ISEA,DTG,CAD, DoLimiterRefraction)
4683  CALL prop_refraction_pr3(ip,isea,dtg,cad,dolimiterrefraction)
4684  ELSE
4685  cad=zero
4686  END IF
4687 #ifdef W3_DEBUGREFRACTION
4688  WRITE(740+iaproc,*) 'refraction IP=', ip, ' ISEA=', isea
4689  WRITE(740+iaproc,*) 'sum(abs(CAD))=', sum(abs(cad))
4690 #endif
4691  cad_the(:,ip)=cad
4692  cp_the = dtg*max(zero,cad)
4693  cm_the = dtg*min(zero,cad)
4694  b_the(:) = cp_the(:) - cm_the(:)
4695  aspar_diag_local(:,ip) = aspar_diag_local(:,ip) + b_the(:)*esi
4696  END IF
4697 
4698  END DO

References aspar_jac, cad_the, cas_sig, w3adatmd::cg, cwnb_sig_m2, w3gdatmd::dmin, w3gdatmd::dsip, w3adatmd::dw, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, freqshiftmethod, w3gdatmd::fsfreqshift, w3gdatmd::fsrefraction, w3odatmd::iaproc, w3parall::imem, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, yownodepool::pdlib_i_diag, yownodepool::pdlib_si, w3parall::prop_freq_shift(), w3parall::prop_freq_shift_m2(), w3parall::prop_refraction_pr1(), w3parall::prop_refraction_pr3(), w3servmd::strace(), and w3parall::zero.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ calcarray_jacobi_vec()

subroutine pdlib_w3profsmd::calcarray_jacobi_vec ( real, intent(in)  DTG,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  VGX,
real, intent(in)  VGY 
)

Definition at line 3515 of file w3profsmd_pdlib.F90.

3515  !/
3516  !/ +-----------------------------------+
3517  !/ | WAVEWATCH III NOAA/NCEP |
3518  !/ | |
3519  !/ | Aron Roland (BGS IT&E GmbH) |
3520  !/ | Mathieu Dutour-Sikiric (IRB) |
3521  !/ | |
3522  !/ | FORTRAN 90 |
3523  !/ | Last update : 01-June-2018 |
3524  !/ +-----------------------------------+
3525  !/
3526  !/ 01-June-2018 : Origination. ( version 6.04 )
3527  !/
3528  ! 1. Purpose : Compute matrix coefficients for advection part
3529  ! 2. Method :
3530  ! 3. Parameters :
3531  !
3532  ! Parameter list
3533  ! ----------------------------------------------------------------
3534  ! ----------------------------------------------------------------
3535  !
3536  ! 4. Subroutines used :
3537  !
3538  ! Name Type Module Description
3539  ! ----------------------------------------------------------------
3540  ! STRACE Subr. W3SERVMD Subroutine tracing.
3541  ! ----------------------------------------------------------------
3542  !
3543  ! 5. Called by :
3544  !
3545  ! Name Type Module Description
3546  ! ----------------------------------------------------------------
3547  ! ----------------------------------------------------------------
3548  !
3549  ! 6. Error messages :
3550  ! 7. Remarks
3551  ! 8. Structure :
3552  ! 9. Switches :
3553  !
3554  ! !/S Enable subroutine tracing.
3555  !
3556  ! 10. Source code :
3557  !
3558  !/ ------------------------------------------------------------------- /
3559 #ifdef W3_S
3560  USE w3servmd, only: strace
3561 #endif
3562  !
3563  USE w3gdatmd, only: nk, nk2, nth, nspec, fachfa, dmin
3565  USE w3gdatmd, only: nseal, clats
3566  USE w3gdatmd, only: mapsta, sig
3567  USE w3wdatmd, only: va
3568  USE w3adatmd, only: cg, dw, wn, cx, cy
3569  USE w3idatmd, only: flcur, fllev
3570  USE w3gdatmd, only: ecos, esin, mapfs
3571  USE w3parall, only : onesixth, zero, thr
3572  use yowelementpool, only: ne, ine
3573  USE yownodepool, only: pdlib_ien, pdlib_tria, &
3577  USE w3odatmd, only : iaproc
3578  USE w3parall, only : zero
3579  USE w3dispmd, only : wavnu_local
3580 #ifdef W3_DB1
3581  USE w3sdb1md
3582  USE w3gdatmd, only: sdbsc
3583 #endif
3584 #ifdef W3_BT1
3585  USE w3sbt1md
3586 #endif
3587 #ifdef W3_BT4
3588  USE w3sbt4md
3589 #endif
3590 #ifdef W3_BT8
3591  USE w3sbt8md
3592 #endif
3593 #ifdef W3_BT9
3594  USE w3sbt9md
3595 #endif
3596 #ifdef W3_IC1
3597  USE w3sic1md
3598 #endif
3599 #ifdef W3_IC2
3600  USE w3sic2md
3601 #endif
3602 #ifdef W3_IC3
3603  USE w3sic3md
3604 #endif
3605 #ifdef W3_TR1
3606  USE w3str1md
3607 #endif
3608  REAL, INTENT(in) :: DTG, FACX, FACY, VGX, VGY
3609  INTEGER :: IP, ISP, ISEA, IP_glob
3610  INTEGER :: idx, IS
3611  INTEGER :: I, J, ITH, IK, J2
3612  INTEGER :: IE, POS, JSEA
3613  INTEGER :: I1, I2, I3, NI(3)
3614  INTEGER :: counter, IB1, IB2, IBR
3615  REAL :: DTK, TMP3
3616  REAL :: LAMBDA(2), CXYY(2,3), CXY(2,NPA)
3617  REAL :: FL11, FL12
3618  REAL :: FL21, FL22
3619  REAL :: FL31, FL32
3620  REAL :: CRFS(3), K(3)
3621  REAL :: KP(3,NE)
3622  REAL :: KM(3), DELTAL(3,NE)
3623  REAL :: K1, eSI, eVS, eVD
3624  REAL :: eVal1, eVal2, eVal3
3625  REAL :: CG1, WN1
3626  REAL :: TRIA03, SIDT, CCOS, CSIN
3627  REAL :: SPEC(NSPEC), DEPTH, CCOSA(NTH), CSINA(NTH)
3628  INTEGER :: IOBPTH1(NTH), IOBPTH2(NTH)
3629 
3630 #ifdef W3_DEBUGSOLVER
3631  WRITE(740+iaproc,*) 'calcARRAY_JACOBI, begin'
3632  FLUSH(740+iaproc)
3633 #endif
3634  memunit = 50000+iaproc
3635 
3636  i = 0
3637  ie = 0
3638  pos = 0
3639  i1 = 0
3640  i2 = 0
3641  i3 = 0
3642  dtk = 0
3643  tmp3 = 0
3644 
3645  ccosa = facx * ecos(1:nth)
3646  csina = facx * esin(1:nth)
3647  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 0')
3648 
3649  DO isp = 1, nspec
3650 
3651  ith = 1 + mod(isp-1,nth)
3652  ik = 1 + (isp-1)/nth
3653  ccos = ccosa(ith)
3654  csin = csina(ith)
3655 
3656  DO ip = 1, npa
3657 
3658  ip_glob = iplg(ip)
3659 #ifdef NOCGTABLE
3660  CALL wavnu_local(sig(ik),dw(ip_glob),wn1,cg1)
3661 #else
3662  cg1 = cg(ik,ip_glob)
3663 #endif
3664  cxy(1,ip) = ccos * cg1/clats(ip_glob)
3665  cxy(2,ip) = csin * cg1
3666  IF (flcur) THEN
3667  cxy(1,ip) = cxy(1,ip) + facx * cx(ip_glob)/clats(ip_glob)*iobdp_loc(ip)
3668  cxy(2,ip) = cxy(2,ip) + facy * cy(ip_glob)*iobdp_loc(ip)
3669  ENDIF
3670 #ifdef W3_MGP
3671  cxy(1,ip) = cxy(1,ip) - ccurx*vgx/clats(isea)
3672  cxy(2,ip) = cxy(2,ip) - ccury*vgy
3673 #endif
3674  ENDDO
3675 
3676  DO ie = 1, ne
3677  ni = ine(:,ie)
3678  cxyy(1,:) = cxy(1,ni)
3679  cxyy(2,:) = cxy(2,ni)
3680  fl11 = cxyy(1,2)*pdlib_ien(1,ie)+cxyy(2,2)*pdlib_ien(2,ie)
3681  fl12 = cxyy(1,3)*pdlib_ien(1,ie)+cxyy(2,3)*pdlib_ien(2,ie)
3682  fl21 = cxyy(1,3)*pdlib_ien(3,ie)+cxyy(2,3)*pdlib_ien(4,ie)
3683  fl22 = cxyy(1,1)*pdlib_ien(3,ie)+cxyy(2,1)*pdlib_ien(4,ie)
3684  fl31 = cxyy(1,1)*pdlib_ien(5,ie)+cxyy(2,1)*pdlib_ien(6,ie)
3685  fl32 = cxyy(1,2)*pdlib_ien(5,ie)+cxyy(2,2)*pdlib_ien(6,ie)
3686  crfs(1) = - onesixth * (2.0d0 *fl31 + fl32 + fl21 + 2.0d0 * fl22 )
3687  crfs(2) = - onesixth * (2.0d0 *fl32 + 2.0d0 * fl11 + fl12 + fl31 )
3688  crfs(3) = - onesixth * (2.0d0 *fl12 + 2.0d0 * fl21 + fl22 + fl11 )
3689  lambda(1) = onesixth * sum(cxyy(1,:))
3690  lambda(2) = onesixth * sum(cxyy(2,:))
3691  k(1) = lambda(1) * pdlib_ien(1,ie) + lambda(2) * pdlib_ien(2,ie)
3692  k(2) = lambda(1) * pdlib_ien(3,ie) + lambda(2) * pdlib_ien(4,ie)
3693  k(3) = lambda(1) * pdlib_ien(5,ie) + lambda(2) * pdlib_ien(6,ie)
3694  kp(1:3,ie) = max(zero,k(1:3))
3695  deltal(1:3,ie) = (crfs(1:3) - kp(1:3,ie)) * 1.d0/min(-thr,sum(min(zero,k(1:3))))
3696  ENDDO
3697 
3698  j = 0
3699  DO ip = 1, np
3700  ib1 = (1-iobpa_loc(ip)) * iobpd_loc(ith,ip)
3701  ib2 = iobpd_loc(ith,ip)
3702 #ifdef W3_REF1
3703  ibr = (1-iobp_loc(ip)) * (1-iobpd_loc(ith,ip)) * (1-iobpa_loc(ip))
3704 #endif
3705  IF (iobdp_loc(ip) .eq. 1) THEN
3706  DO i = 1, pdlib_ccon(ip)
3707  j = j + 1
3708  ie = pdlib_ie_cell2(i,ip)
3709  pos = pdlib_pos_cell2(i,ip)
3710 #ifdef W3_DEBUGSRC
3711  WRITE(740+iaproc,*) 'I1=', i1, ' PDLIB_I_DIAG=', pdlib_i_diag(ip)
3712 #endif
3713 
3714 #ifdef W3_REF1
3715  IF (ibr == 1) THEN
3716  dtk = kp(pos,ie) * dtg
3717  b_jac(isp,ip) = b_jac(isp,ip) + pdlib_tria03(ie) * va(isp,ip)
3718  ELSE
3719  dtk = kp(pos,ie) * dtg * ib1
3720  b_jac(isp,ip) = b_jac(isp,ip) + pdlib_tria03(ie) * va(isp,ip) * ib2
3721  ENDIF
3722 #else
3723  dtk = kp(pos,ie) * dtg * ib1
3724  b_jac(isp,ip) = b_jac(isp,ip) + pdlib_tria03(ie) * va(isp,ip) * ib2
3725 #endif
3726 
3727  i1 = pdlib_posi(1,j)
3728  i2 = pdlib_posi(2,j)
3729  i3 = pdlib_posi(3,j)
3730  IF (fsgeoadvect) THEN
3731  aspar_jac(isp,i1) = aspar_jac(isp,i1) + pdlib_tria03(ie) + dtk - dtk * deltal(pos,ie)
3732  aspar_jac(isp,i2) = aspar_jac(isp,i2) - dtk * deltal(pos_trick(pos,1),ie)
3733  aspar_jac(isp,i3) = aspar_jac(isp,i3) - dtk * deltal(pos_trick(pos,2),ie)
3734  ELSE
3735  aspar_jac(isp,i1) = aspar_jac(isp,i1) + pdlib_tria03(ie)
3736  ENDIF
3737  END DO
3738  ELSE
3739  DO i = 1, pdlib_ccon(ip)
3740  j = j + 1
3741  i1 = pdlib_posi(1,j)
3742  ie = pdlib_ie_cell2(i,ip)
3743  aspar_jac(isp,i1) = aspar_jac(isp,i1) + pdlib_tria03(ie)
3744  END DO
3745  b_jac(isp,ip) = 0.
3746  ENDIF
3747  END DO
3748  END DO ! ISP
3749 
3750  call print_memcheck(memunit, 'memcheck_____:'//' WW3_JACOBI SECTION 1')
3751 #ifdef W3_DEBUGSOLVER
3752  WRITE(740+iaproc,*) 'sum(VA)=', sum(va)
3753  CALL printtotaloffcontrib("Offdiag after the geo advection")
3754 #endif
3755  !/
3756  !/ End of W3XYPFSN ----------------------------------------------------- /
3757  !/

References aspar_jac, b_jac, w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dmin, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3idatmd::flcur, w3idatmd::fllev, fsgeoadvect, w3odatmd::iaproc, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3gdatmd::mapfs, w3gdatmd::mapsta, memunit, yowelementpool::ne, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3parall::onesixth, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia, yownodepool::pdlib_ia_p, yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_pos_cell2, yownodepool::pdlib_posi, yownodepool::pdlib_si, yownodepool::pdlib_tria, yownodepool::pdlib_tria03, pos_trick, printtotaloffcontrib(), w3gdatmd::sdbsc, w3gdatmd::sig, w3servmd::strace(), w3parall::thr, w3wdatmd::va, w3dispmd::wavnu_local(), w3adatmd::wn, and w3parall::zero.

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ check_array_integral_nx_r8()

subroutine pdlib_w3profsmd::check_array_integral_nx_r8 ( real, dimension(nspec, npa), intent(in)  TheARR,
character(*), intent(in)  string,
integer, intent(in)  maxidx 
)

Definition at line 2661 of file w3profsmd_pdlib.F90.

2661  !/
2662  !/ +-----------------------------------+
2663  !/ | WAVEWATCH III NOAA/NCEP |
2664  !/ | |
2665  !/ | Aron Roland (BGS IT&E GmbH) |
2666  !/ | Mathieu Dutour-Sikiric (IRB) |
2667  !/ | |
2668  !/ | FORTRAN 90 |
2669  !/ | Last update : 01-June-2018 |
2670  !/ +-----------------------------------+
2671  !/
2672  !/ 01-June-2018 : Origination. ( version 6.04 )
2673  !/
2674  ! 1. Purpose : Source code for parallel debugging
2675  ! 2. Method :
2676  ! 3. Parameters :
2677  !
2678  ! Parameter list
2679  ! ----------------------------------------------------------------
2680  ! ----------------------------------------------------------------
2681  !
2682  ! 4. Subroutines used :
2683  !
2684  ! Name Type Module Description
2685  ! ----------------------------------------------------------------
2686  ! STRACE Subr. W3SERVMD Subroutine tracing.
2687  ! ----------------------------------------------------------------
2688  !
2689  ! 5. Called by :
2690  !
2691  ! Name Type Module Description
2692  ! ----------------------------------------------------------------
2693  ! ----------------------------------------------------------------
2694  !
2695  ! 6. Error messages :
2696  ! 7. Remarks
2697  ! 8. Structure :
2698  ! 9. Switches :
2699  !
2700  ! !/S Enable subroutine tracing.
2701  !
2702  ! 10. Source code :
2703  !
2704  !/ ------------------------------------------------------------------- /
2705 
2706  USE w3gdatmd, only : nspec
2707  USE yownodepool, only: npa
2708  CHARACTER(*), INTENT(in) :: string
2709  INTEGER, INTENT(in) :: maxidx
2710  REAL, INTENT(in) :: TheARR(NSPEC, npa)
2711  real*8 :: thearr_red(npa)
2712  ! LOGICAL :: FULL_NSPEC = .FALSE.
2713  ! LOGICAL :: PrintMinISP = .FALSE.
2714  ! LOGICAL :: LocalizeMaximum = .FALSE.
2715  ! LOGICAL :: CheckUncovered = .FALSE.
2716  ! LOGICAL :: PrintFullValue = .FALSE.
2717  LOGICAL :: FULL_NSPEC = .true.
2718  LOGICAL :: PrintMinISP = .true.
2719  LOGICAL :: LocalizeMaximum = .true.
2720  LOGICAL :: CheckUncovered = .true.
2721  LOGICAL :: PrintFullValue = .true.
2722  integer :: ip
2723 
2724  IF (full_nspec) THEN
2725  CALL check_array_integral_nx_r8_maxfunct(thearr, string, maxidx, printminisp, localizemaximum)
2726  ELSE
2727  DO ip=1,npa
2728  thearr_red(ip) = sum(abs(thearr(:,ip)))
2729  END DO
2730  CALL scal_integral_print_general(thearr_red, string, maxidx, checkuncovered, printfullvalue)
2731  END IF

References check_array_integral_nx_r8_maxfunct(), yownodepool::npa, w3gdatmd::nspec, and scal_integral_print_general().

Referenced by pdlib_jacobi_gauss_seidel_block().

◆ check_array_integral_nx_r8_maxfunct()

subroutine pdlib_w3profsmd::check_array_integral_nx_r8_maxfunct ( real, dimension(nspec, npa), intent(in)  TheARR,
character(*), intent(in)  string,
integer, intent(in)  maxidx,
logical, intent(in)  PrintMinISP,
logical, intent(in)  LocalizeMaximum 
)

Definition at line 2450 of file w3profsmd_pdlib.F90.

2450  !/
2451  !/ +-----------------------------------+
2452  !/ | WAVEWATCH III NOAA/NCEP |
2453  !/ | |
2454  !/ | Aron Roland (BGS IT&E GmbH) |
2455  !/ | Mathieu Dutour-Sikiric (IRB) |
2456  !/ | |
2457  !/ | FORTRAN 90 |
2458  !/ | Last update : 01-June-2018 |
2459  !/ +-----------------------------------+
2460  !/
2461  !/ 01-June-2018 : Origination. ( version 6.04 )
2462  !/
2463  ! 1. Purpose : Source code for parallel debugging
2464  ! 2. Method :
2465  ! 3. Parameters :
2466  !
2467  ! Parameter list
2468  ! ----------------------------------------------------------------
2469  ! ----------------------------------------------------------------
2470  !
2471  ! 4. Subroutines used :
2472  !
2473  ! Name Type Module Description
2474  ! ----------------------------------------------------------------
2475  ! STRACE Subr. W3SERVMD Subroutine tracing.
2476  ! ----------------------------------------------------------------
2477  !
2478  ! 5. Called by :
2479  !
2480  ! Name Type Module Description
2481  ! ----------------------------------------------------------------
2482  ! ----------------------------------------------------------------
2483  !
2484  ! 6. Error messages :
2485  ! 7. Remarks
2486  ! 8. Structure :
2487  ! 9. Switches :
2488  !
2489  ! !/S Enable subroutine tracing.
2490  !
2491  ! 10. Source code :
2492  !
2493  !/ ------------------------------------------------------------------- /
2494 
2495  USE w3gdatmd, only : nk, nth
2496  USE w3gdatmd, only : nspec, nx, ny, nseal, mapfs
2497  USE w3adatmd, only : mpi_comm_wcmp
2498  USE w3gdatmd, only : gtype, ungtype
2499  USE w3odatmd, only : iaproc, naproc, ntproc
2500  use yowdatapool, only: rtype, istatus
2501  USE yownodepool, only: npa, iplg
2502  USE w3parall, only: init_get_isea
2503 
2504  include "mpif.h"
2505  CHARACTER(*), INTENT(in) :: string
2506  INTEGER, INTENT(in) :: maxidx
2507  REAL, INTENT(in) :: TheARR(NSPEC, npa)
2508  LOGICAL, INTENT(in) :: PrintMinISP, LocalizeMaximum
2509  !
2510  REAL Vcoll(NSPEC,NX), VcollExp(NSPEC*NX), rVect(NSPEC*NX)
2511  REAL CoherencyError_Max, CoherencyError_Sum
2512  REAL eVal1, eVal2, eErr
2513  INTEGER LocateMax_I, LocateMax_ISP
2514  INTEGER rStatus(NX), Status(NX)
2515  INTEGER JSEA, ISEA, iProc, I, IX, ierr, ISP, IP, IP_glob
2516  REAL :: mval, eVal, eSum
2517  REAL :: TheMax, TheSum, TheNb, TheAvg
2518  REAL :: eFact, Threshold
2519  LOGICAL :: IsFirst
2520  INTEGER nbIncorr, n_control
2521  INTEGER ITH, IK
2522  INTEGER :: TEST_IP = 46
2523  INTEGER :: TEST_ISP = 370
2524  IF (iaproc .gt. naproc) THEN
2525  RETURN
2526  END IF
2527  IF (gtype .ne. ungtype) THEN
2528  RETURN
2529  END IF
2530  WRITE(740+iaproc,*) 'CHECK_ARRAY_INTEGRAL NSEAL=', nseal, ' npa=', npa, ' maxidx=', maxidx
2531  vcollexp=0
2532  status=0
2533  DO ip=1,maxidx
2534  ip_glob=iplg(ip)
2535  DO isp=1,nspec
2536  vcollexp(isp+nspec*(ip_glob-1)) = thearr(isp,ip)
2537  IF ((ip_glob .eq. test_ip).and.(isp .eq. test_isp)) THEN
2538  WRITE(740+iaproc,*) 'TEST_IP=', test_ip, ' TEST_ISP=', test_isp, ' val=', thearr(isp,ip)
2539  END IF
2540  END DO
2541  status(ip_glob)=1
2542  END DO
2543  !
2544  ! Now find global arrays
2545  !
2546  coherencyerror_max = 0
2547  coherencyerror_sum = 0
2548  locatemax_i = -1
2549  locatemax_isp = -1
2550 
2551  n_control = 0
2552  IF (iaproc .eq. 1) THEN
2553  DO iproc=2,naproc
2554  CALL mpi_recv(rvect ,nspec*nx,mpi_real , iproc-1, 37, mpi_comm_wcmp, istatus, ierr)
2555  CALL mpi_recv(rstatus,nx ,mpi_integer, iproc-1, 43, mpi_comm_wcmp, istatus, ierr)
2556  DO i=1,nx
2557  IF (rstatus(i) .eq. 1) THEN
2558  DO isp=1,nspec
2559  eval1 = vcollexp(isp+nspec*(i-1))
2560  eval2 = rvect(isp+nspec*(i-1))
2561  IF (status(i) .eq. 1) THEN
2562  eerr=abs(eval1 - eval2)
2563  coherencyerror_sum = coherencyerror_sum + eerr
2564  IF (eerr .gt. coherencyerror_max) THEN
2565  coherencyerror_max = eerr
2566  locatemax_i = i
2567  locatemax_isp = isp
2568  END IF
2569  IF (isp .eq. 1) THEN
2570  n_control = n_control + 1
2571  END IF
2572  ELSE
2573  vcollexp(isp+nspec*(i-1))=eval2
2574  END IF
2575  END DO
2576  status(i)=1
2577  END IF
2578  END DO
2579  END DO
2580  ELSE
2581  CALL mpi_send(vcollexp,nspec*nx,mpi_real , 0, 37, mpi_comm_wcmp, ierr)
2582  CALL mpi_send(status ,nx ,mpi_integer, 0, 43, mpi_comm_wcmp, ierr)
2583  END IF
2584  IF (iaproc .eq. 1) THEN
2585  DO i=1,nx
2586  DO isp=1,nspec
2587  vcoll(isp,i)=vcollexp(isp + nspec*(i-1))
2588  END DO
2589  END DO
2590  nbincorr=0
2591  DO ix=1,nx
2592  isea=mapfs(1,ix)
2593  IF (isea .gt. 0) THEN
2594  IF (status(ix) .eq. 0) THEN
2595  nbincorr=nbincorr+1
2596  END IF
2597  END IF
2598  END DO
2599  IF (nbincorr .gt. 0) THEN
2600  WRITE(*,*) ' nbIncorr=', nbincorr
2601  WRITE(*,*) ' NX=', nx
2602  WRITE(*,*) ' npa=', npa
2603  stop
2604  END IF
2605  WRITE(740+iaproc,*) 'CHECK_ARRAY_INTEGRAL n_control=', n_control
2606  WRITE(740+iaproc,*) 'ARRAY_NX sum,coh=', sum(vcoll), coherencyerror_sum, trim(string)
2607  WRITE(740+iaproc,*) 'ARRAY_NX max,loc=', coherencyerror_max,locatemax_i,locatemax_isp, trim(string)
2608  IF (printminisp) THEN
2609  DO isp=1,nspec
2610  isfirst=.true.
2611  esum=0
2612  DO ip=1,maxidx
2613  eval=abs(vcoll(isp, ip))
2614  esum=esum + eval
2615  IF (isfirst.eqv. .true.) then
2616  mval=eval
2617  ELSE
2618  IF (eval .lt. mval) THEN
2619  mval=eval
2620  ENDIF
2621  ENDIF
2622  isfirst=.false.
2623  END DO
2624  WRITE(740+iaproc,*) 'ISP=', isp, ' mval/sum=', mval, esum
2625  END DO
2626  FLUSH(740+iaproc)
2627  END IF
2628  IF (localizemaximum) THEN
2629  themax=0
2630  thenb=0
2631  thesum=0
2632  DO ip=1,maxidx
2633  DO isp=1,nspec
2634  eval = abs(vcoll(isp, ip))
2635  thesum = thesum + eval
2636  thenb = thenb + 1
2637  IF (eval .gt. themax) THEN
2638  themax=eval
2639  END IF
2640  END DO
2641  END DO
2642  theavg = thesum / thenb
2643  WRITE(740+iaproc,*) 'TheAvg/TheMax=', theavg, themax
2644  efact=0.5
2645  threshold=efact * themax
2646  DO ip=1,maxidx
2647  DO isp=1,nspec
2648  eval = abs(vcoll(isp, ip))
2649  IF (eval .gt. threshold) THEN
2650  WRITE(740+iaproc,*) 'ISP/IP/val=', isp, ip, eval
2651  END IF
2652  END DO
2653  END DO
2654  FLUSH(740+iaproc)
2655  END IF
2656  END IF

References w3gdatmd::gtype, w3odatmd::iaproc, include(), w3parall::init_get_isea(), yownodepool::iplg, yowdatapool::istatus, w3gdatmd::mapfs, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, w3gdatmd::nk, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3odatmd::ntproc, w3gdatmd::nx, w3gdatmd::ny, yowdatapool::rtype, and w3gdatmd::ungtype.

Referenced by all_field_integral_print(), all_va_integral_print(), all_vaold_integral_print(), and check_array_integral_nx_r8().

◆ compute_mean_param()

subroutine pdlib_w3profsmd::compute_mean_param ( real, dimension(nth,nk), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, intent(out)  EMEAN,
real, intent(out)  FMEAN,
real, intent(out)  WNMEAN,
real, intent(out)  AMAX 
)

Definition at line 3170 of file w3profsmd_pdlib.F90.

3170  !/
3171  !/ +-----------------------------------+
3172  !/ | WAVEWATCH III NOAA/NCEP |
3173  !/ | |
3174  !/ | Aron Roland (BGS IT&E GmbH) |
3175  !/ | Mathieu Dutour-Sikiric (IRB) |
3176  !/ | |
3177  !/ | FORTRAN 90 |
3178  !/ | Last update : 01-June-2018 |
3179  !/ +-----------------------------------+
3180  !/
3181  !/ 01-June-2018 : Origination. ( version 6.04 )
3182  !/
3183  ! 1. Purpose : Compute mean prarameter
3184  ! 2. Method :
3185  ! 3. Parameters :
3186  !
3187  ! Parameter list
3188  ! ----------------------------------------------------------------
3189  ! ----------------------------------------------------------------
3190  !
3191  ! 4. Subroutines used :
3192  !
3193  ! Name Type Module Description
3194  ! ----------------------------------------------------------------
3195  ! STRACE Subr. W3SERVMD Subroutine tracing.
3196  ! ----------------------------------------------------------------
3197  !
3198  ! 5. Called by :
3199  !
3200  ! Name Type Module Description
3201  ! ----------------------------------------------------------------
3202  ! ----------------------------------------------------------------
3203  !
3204  ! 6. Error messages :
3205  ! 7. Remarks
3206  ! 8. Structure :
3207  ! 9. Switches :
3208  !
3209  ! !/S Enable subroutine tracing.
3210  !
3211  ! 10. Source code :
3212  !
3213  !/ ------------------------------------------------------------------- /
3214 #ifdef W3_S
3215  USE w3servmd, only: strace
3216 #endif
3217  !
3218  USE constants
3219  USE w3gdatmd, only: nk, nth, sig, dden, fte, ftf, ftwn
3220 #ifdef W3_T
3221  USE w3odatmd, only: ndst
3222 #endif
3223 #ifdef W3_S
3224  USE w3servmd, only: strace
3225 #endif
3226  !
3227  REAL, INTENT(IN) :: A(NTH,NK), CG(NK), WN(NK)
3228  REAL, INTENT(OUT) :: EMEAN, FMEAN, WNMEAN, AMAX
3229  INTEGER :: IK, ITH
3230 #ifdef W3_S
3231  INTEGER, SAVE :: IENT = 0
3232 #endif
3233  REAL :: EB(NK), EBAND
3234 #ifdef W3_S
3235  CALL strace (ient, 'W3SPR0')
3236 #endif
3237  !
3238  emean = 0.
3239  fmean = 0.
3240  wnmean = 0.
3241  amax = 0.
3242  !
3243  ! 1. Integral over directions
3244  !
3245  DO ik=1, nk
3246  eb(ik) = 0.
3247  DO ith=1, nth
3248  eb(ik) = eb(ik) + a(ith,ik)
3249  amax = max( amax , a(ith,ik) )
3250  END DO
3251  END DO
3252  !
3253  ! 2. Integrate over directions
3254  !
3255  DO ik=1, nk
3256  eb(ik) = eb(ik) * dden(ik) / cg(ik)
3257  emean = emean + eb(ik)
3258  fmean = fmean + eb(ik) / sig(ik)
3259  wnmean = wnmean + eb(ik) / sqrt(wn(ik))
3260  END DO
3261  !
3262  ! 3. Add tail beyond discrete spectrum
3263  ! ( DTH * SIG absorbed in FTxx )
3264  !
3265  eband = eb(nk) / dden(nk)
3266  emean = emean + eband * fte
3267  fmean = fmean + eband * ftf
3268  wnmean = wnmean + eband * ftwn
3269  !
3270  ! 4. Final processing
3271  !
3272  fmean = tpiinv * emean / max( 1.e-7 , fmean )
3273  wnmean = ( emean / max( 1.e-7 , wnmean ) )**2
3274  !
3275 #ifdef W3_T
3276  WRITE (ndst,9000) emean, fmean, wnmean
3277 #endif
3278  !
3279  RETURN
3280  !
3281  ! Formats
3282  !
3283 #ifdef W3_T
3284 9000 FORMAT (' TEST W3SPR0 : E,F,WN MEAN ',3e10.3)
3285 #endif
3286  !/
3287  !/ End of W3SPR0 ----------------------------------------------------- /
3288  !/

References w3gdatmd::dden, w3gdatmd::fte, w3gdatmd::ftf, w3gdatmd::ftwn, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nth, w3gdatmd::sig, w3servmd::strace(), and constants::tpiinv.

Referenced by calcarray_jacobi_source_1(), and calcarray_jacobi_source_2().

◆ deallocate_pdlib_global()

subroutine pdlib_w3profsmd::deallocate_pdlib_global ( integer, intent(in)  IMOD)

Definition at line 7278 of file w3profsmd_pdlib.F90.

7278  !/
7279  !/ +-----------------------------------+
7280  !/ | WAVEWATCH III NOAA/NCEP |
7281  !/ | |
7282  !/ | Aron Roland (BGS IT&E GmbH) |
7283  !/ | Mathieu Dutour-Sikiric (IRB) |
7284  !/ | |
7285  !/ | FORTRAN 90 |
7286  !/ | Last update : 01-June-2018 |
7287  !/ +-----------------------------------+
7288  !/
7289  !/ 01-June-2018 : Origination. ( version 6.04 )
7290  !/
7291  ! 1. Purpose : Init jacobi solver
7292  ! 2. Method :
7293  ! 3. Parameters :
7294  !
7295  ! Parameter list
7296  ! ----------------------------------------------------------------
7297  ! ----------------------------------------------------------------
7298  !
7299  ! 4. Subroutines used :
7300  !
7301  ! Name Type Module Description
7302  ! ----------------------------------------------------------------
7303  ! STRACE Subr. W3SERVMD Subroutine tracing.
7304  ! ----------------------------------------------------------------
7305  !
7306  ! 5. Called by :
7307  !
7308  ! Name Type Module Description
7309  ! ----------------------------------------------------------------
7310  ! ----------------------------------------------------------------
7311  !
7312  ! 6. Error messages :
7313  ! 7. Remarks
7314  ! 8. Structure :
7315  ! 9. Switches :
7316  !
7317  ! !/S Enable subroutine tracing.
7318  !
7319  ! 10. Source code :
7320  !
7321  !/ ------------------------------------------------------------------- /
7322 #ifdef W3_S
7323  USE w3servmd, only: strace
7324 #endif
7326  use yownodepool, only: pdlib_nnz, npa, np
7327  USE yowfunction, only: pdlib_abort
7328  USE w3gdatmd, only: nth, nk, nseal
7329  USE w3parall, only: imem
7330 #ifdef W3_DEBUGINIT
7331  USE w3odatmd, only : iaproc
7332 #endif
7333  !/
7334  !/
7335  !/ ------------------------------------------------------------------- /
7336  !/ Parameter list
7337  !/
7338  !/ ------------------------------------------------------------------- /
7339  !/ Local PARAMETERs
7340  !/
7341 #ifdef W3_S
7342  INTEGER, SAVE :: IENT = 0
7343 #endif
7344  !/
7345  !/ ------------------------------------------------------------------- /
7346  !/
7347  INTEGER, INTENT(IN) :: IMOD
7348 
7349  DEALLOCATE ( &
7350  ! GRIDS(IMOD)%TRIGP, &
7351  grids(imod)%SI, &
7352  grids(imod)%TRIA, &
7353  grids(imod)%CROSSDIFF, &
7354  grids(imod)%IEN, &
7355  grids(imod)%LEN, &
7356  grids(imod)%ANGLE, &
7357  grids(imod)%ANGLE0, &
7358  grids(imod)%CCON, &
7359  grids(imod)%COUNTCON, &
7360  grids(imod)%INDEX_CELL, &
7361  grids(imod)%IE_CELL, &
7362  grids(imod)%POS_CELL, &
7363  grids(imod)%IAA, &
7364  grids(imod)%JAA, &
7365  grids(imod)%POSI, &
7366  grids(imod)%I_DIAG, &
7367  grids(imod)%JA_IE, &
7368  !GRIDS(IMOD)%IOBP, &
7369  !GRIDS(IMOD)%IOBPD, &
7370  grids(imod)%IOBDP, &
7371  grids(imod)%IOBPA )
7372  !/
7373  !/ End of DEALLOCATE_PDLIB_GLOBAL ------------------------------------------------ /
7374  !/

References w3gdatmd::b_jgs_block_gauss_seidel, w3gdatmd::grids, w3odatmd::iaproc, w3parall::imem, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, yowfunction::pdlib_abort(), yownodepool::pdlib_nnz, and w3servmd::strace().

Referenced by w3initmd::w3init().

◆ ergout()

subroutine pdlib_w3profsmd::ergout ( integer, intent(in)  FHNDL,
character(len=*), intent(in)  ERGNAME 
)

Definition at line 7378 of file w3profsmd_pdlib.F90.

7378  !/
7379  !/ +-----------------------------------+
7380  !/ | WAVEWATCH III NOAA/NCEP |
7381  !/ | |
7382  !/ | Aron Roland (BGS IT&E GmbH) |
7383  !/ | |
7384  !/ | FORTRAN 90 |
7385  !/ | Last update : 01-Januar-2023 |
7386  !/ +-----------------------------------+
7387  !/
7388  !/ 01-June-2018 : Origination. ( version 7.xx )
7389  !/
7390  ! 1. Purpose : write spatial out for xfn
7391  ! 2. Method :
7392  ! 3. Parameters :
7393  !
7394  ! Parameter list
7395  ! ----------------------------------------------------------------
7396  ! ----------------------------------------------------------------
7397  !
7398  ! 4. Subroutines used :
7399  !
7400  ! Name Type Module Description
7401  ! ----------------------------------------------------------------
7402  ! STRACE Subr. W3SERVMD Subroutine tracing.
7403  ! ----------------------------------------------------------------
7404  !
7405  ! 5. Called by :
7406  !
7407  ! Name Type Module Description
7408  ! ----------------------------------------------------------------
7409  ! ----------------------------------------------------------------
7410  !
7411  ! 6. Error messages :
7412  ! 7. Remarks
7413  ! 8. Structure :
7414  ! 9. Switches :
7415  !
7416  ! !/S Enable subroutine tracing.
7417  !
7418  ! 10. Source code :
7419  !
7420  !/ ------------------------------------------------------------------- /
7421 #ifdef W3_S
7422  USE w3servmd, only: strace
7423 #endif
7424  USE w3gdatmd, only: nspec, nth, nk, nseal
7425  USE w3wdatmd, only: va, vaold
7426  IMPLICIT NONE
7427 
7428  INTEGER, INTENT(IN) :: FHNDL
7429  CHARACTER(LEN=*), INTENT(IN) :: ERGNAME
7430  REAL :: SUMVA(NSEAL)
7431  INTEGER :: JSEA
7432 
7433  IF (linit_output) THEN
7434  OPEN(fhndl, file = trim(ergname), form = 'UNFORMATTED')
7435  linit_output = .false.
7436  ENDIF
7437 
7438  rtime = rtime + 1.
7439 
7440  DO jsea = 1, nseal
7441  sumva(jsea) = sum(va(:,jsea))
7442  ENDDO
7443 
7444  WRITE(fhndl) rtime
7445  WRITE(fhndl) (sumva(jsea), sumva(jsea), sumva(jsea), jsea = 1, nseal)
7446 

References file(), linit_output, w3gdatmd::nk, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, rtime, w3servmd::strace(), w3wdatmd::va, and w3wdatmd::vaold.

◆ jacobi_finalize()

subroutine pdlib_w3profsmd::jacobi_finalize

Definition at line 7550 of file w3profsmd_pdlib.F90.

7550  !/
7551  !/ +-----------------------------------+
7552  !/ | WAVEWATCH III NOAA/NCEP |
7553  !/ | |
7554  !/ | Aron Roland (BGS IT&E GmbH) |
7555  !/ | Mathieu Dutour-Sikiric (IRB) |
7556  !/ | |
7557  !/ | FORTRAN 90 |
7558  !/ | Last update : 01-June-2018 |
7559  !/ +-----------------------------------+
7560  !/
7561  !/ 01-June-2018 : Origination. ( version 6.04 )
7562  !/
7563  ! 1. Purpose : Finalize jacobi solver
7564  ! 2. Method :
7565  ! 3. Parameters :
7566  !
7567  ! Parameter list
7568  ! ----------------------------------------------------------------
7569  ! ----------------------------------------------------------------
7570  !
7571  ! 4. Subroutines used :
7572  !
7573  ! Name Type Module Description
7574  ! ----------------------------------------------------------------
7575  ! STRACE Subr. W3SERVMD Subroutine tracing.
7576  ! ----------------------------------------------------------------
7577  !
7578  ! 5. Called by :
7579  !
7580  ! Name Type Module Description
7581  ! ----------------------------------------------------------------
7582  ! ----------------------------------------------------------------
7583  !
7584  ! 6. Error messages :
7585  ! 7. Remarks
7586  ! 8. Structure :
7587  ! 9. Switches :
7588  !
7589  ! !/S Enable subroutine tracing.
7590  !
7591  ! 10. Source code :
7592  !
7593  !/ ------------------------------------------------------------------- /
7595  USE w3parall, only: imem
7596  !/
7597  !/
7598  !/ ------------------------------------------------------------------- /
7599  !/ Parameter list
7600  !/
7601  !/ ------------------------------------------------------------------- /
7602  !/ Local PARAMETER
7603  !/
7604 #ifdef W3_S
7605  INTEGER, SAVE :: IENT = 0
7606 #endif
7607  !/
7608  !/ ------------------------------------------------------------------- /
7609  !/
7610 #ifdef W3_S
7611  CALL strace (ient, 'JACOBI_FINALIZE')
7612 #endif
7613  IF (imem == 1) THEN
7614  DEALLOCATE(aspar_jac)
7615  ELSE IF (imem == 2) THEN
7616  DEALLOCATE(aspar_diag_all)
7617  ENDIF
7618  DEALLOCATE(b_jac)
7619  DEALLOCATE(cad_the)
7620  IF (freqshiftmethod .eq. 1) THEN
7621  DEALLOCATE(cas_sig)
7622  ELSE IF (freqshiftmethod .eq. 2) THEN
7623  DEALLOCATE(cwnb_sig_m2)
7624  END IF
7625  IF (.NOT. b_jgs_block_gauss_seidel) THEN
7626  DEALLOCATE(u_jac)
7627  END IF
7628  !/
7629  !/ End of JACOBI_FINALIZE -------------------------------------------- /
7630  !/

References aspar_diag_all, aspar_jac, b_jac, w3gdatmd::b_jgs_block_gauss_seidel, cad_the, cas_sig, cwnb_sig_m2, freqshiftmethod, w3parall::imem, w3servmd::strace(), and u_jac.

Referenced by block_solver_finalize().

◆ jacobi_init()

subroutine pdlib_w3profsmd::jacobi_init ( integer, intent(in)  IMOD)

Definition at line 7450 of file w3profsmd_pdlib.F90.

7450  !/
7451  !/ +-----------------------------------+
7452  !/ | WAVEWATCH III NOAA/NCEP |
7453  !/ | |
7454  !/ | Aron Roland (BGS IT&E GmbH) |
7455  !/ | Mathieu Dutour-Sikiric (IRB) |
7456  !/ | |
7457  !/ | FORTRAN 90 |
7458  !/ | Last update : 01-June-2018 |
7459  !/ +-----------------------------------+
7460  !/
7461  !/ 01-June-2018 : Origination. ( version 6.04 )
7462  !/
7463  ! 1. Purpose : Init jacobi solver
7464  ! 2. Method :
7465  ! 3. Parameters :
7466  !
7467  ! Parameter list
7468  ! ----------------------------------------------------------------
7469  ! ----------------------------------------------------------------
7470  !
7471  ! 4. Subroutines used :
7472  !
7473  ! Name Type Module Description
7474  ! ----------------------------------------------------------------
7475  ! STRACE Subr. W3SERVMD Subroutine tracing.
7476  ! ----------------------------------------------------------------
7477  !
7478  ! 5. Called by :
7479  !
7480  ! Name Type Module Description
7481  ! ----------------------------------------------------------------
7482  ! ----------------------------------------------------------------
7483  !
7484  ! 6. Error messages :
7485  ! 7. Remarks
7486  ! 8. Structure :
7487  ! 9. Switches :
7488  !
7489  ! !/S Enable subroutine tracing.
7490  !
7491  ! 10. Source code :
7492  !
7493  !/ ------------------------------------------------------------------- /
7494 #ifdef W3_S
7495  USE w3servmd, only: strace
7496 #endif
7498  use yownodepool, only: pdlib_nnz, npa, np
7499  USE yowfunction, only: pdlib_abort
7500  USE w3gdatmd, only: nth, nk, nseal
7501  USE w3parall, only: imem
7502 #ifdef W3_DEBUGINIT
7503  USE w3odatmd, only : iaproc
7504 #endif
7505  !/
7506  !/
7507  !/ ------------------------------------------------------------------- /
7508  !/ Parameter list
7509  !/
7510  !/ ------------------------------------------------------------------- /
7511  !/ Local PARAMETERs
7512  !/
7513 #ifdef W3_S
7514  INTEGER, SAVE :: IENT = 0
7515 #endif
7516  !/
7517  !/ ------------------------------------------------------------------- /
7518  !/
7519  INTEGER, INTENT(IN) :: IMOD
7520 
7521  INTEGER istat
7522  IF (imem == 1) THEN
7523  ALLOCATE(aspar_jac(nspec, pdlib_nnz), stat=istat)
7524  if(istat /= 0) CALL pdlib_abort(9)
7525  ELSE IF (imem == 2) THEN
7526  ALLOCATE(aspar_diag_all(nspec, npa), stat=istat)
7527  if(istat /= 0) CALL pdlib_abort(9)
7528  ENDIF
7529  ALLOCATE(b_jac(nspec,nseal), stat=istat)
7530  if(istat /= 0) CALL pdlib_abort(10)
7531  ALLOCATE(cad_the(nspec,nseal), stat=istat)
7532  if(istat /= 0) CALL pdlib_abort(11)
7533  IF (freqshiftmethod .eq. 1) THEN
7534  ALLOCATE(cas_sig(nspec,nseal), stat=istat)
7535  if(istat /= 0) CALL pdlib_abort(11)
7536  ELSE IF (freqshiftmethod .eq. 2) THEN
7537  ALLOCATE(cwnb_sig_m2(1-nth:nspec,nseal), stat=istat)
7538  if(istat /= 0) CALL pdlib_abort(11)
7539  END IF
7540  IF (.NOT. b_jgs_block_gauss_seidel) THEN
7541  ALLOCATE(u_jac(nspec,npa), stat=istat)
7542  if(istat /= 0) CALL pdlib_abort(12)
7543  END IF
7544  !/
7545  !/ End of JACOBI_INIT ------------------------------------------------ /
7546  !/

References aspar_diag_all, aspar_jac, b_jac, w3gdatmd::b_jgs_block_gauss_seidel, cad_the, cas_sig, cwnb_sig_m2, freqshiftmethod, w3gdatmd::grids, w3odatmd::iaproc, w3parall::imem, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, yowfunction::pdlib_abort(), yownodepool::pdlib_nnz, w3servmd::strace(), and u_jac.

Referenced by block_solver_init().

◆ pdlib_explicit_block()

subroutine pdlib_w3profsmd::pdlib_explicit_block ( integer, intent(in)  IMOD,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  DTG,
real, intent(in)  VGX,
real, intent(in)  VGY,
logical, intent(in)  LCALC 
)

Definition at line 6332 of file w3profsmd_pdlib.F90.

6332  !/
6333  !/ +-----------------------------------+
6334  !/ | WAVEWATCH III NOAA/NCEP |
6335  !/ | |
6336  !/ | Aron Roland (BGS IT&E GmbH) |
6337  !/ | Mathieu Dutour-Sikiric (IRB) |
6338  !/ | |
6339  !/ | FORTRAN 90 |
6340  !/ | Last update : 01-June-2018 |
6341  !/ +-----------------------------------+
6342  !/
6343  !/ 01-June-2018 : Origination. ( version 6.04 )
6344  !/
6345  ! 1. Purpose : Explicit block solver
6346  ! 2. Method : It uses the n-scheme and the idea is to reduce latency due
6347  ! to DD communication and increase vectorization level on the
6348  ! single core
6349  ! 3. Parameters :
6350  !
6351  ! Parameter list
6352  ! ----------------------------------------------------------------
6353  ! ----------------------------------------------------------------
6354  !
6355  ! 4. Subroutines used :
6356  !
6357  ! Name Type Module Description
6358  ! ----------------------------------------------------------------
6359  !
6360  ! 5. Called by :
6361  !
6362  ! Name Type Module Description
6363  ! ----------------------------------------------------------------
6364  !
6365  ! 6. Error messages :
6366  ! 7. Remarks
6367  ! 8. Structure :
6368  ! 9. Switches :
6369  !
6370  ! !/S Enable subroutine tracing.
6371  !
6372  ! 10. Source code :
6373  !
6374  !/ ------------------------------------------------------------------- /
6375  !
6376 #ifdef W3_S
6377  USE w3servmd, only: strace
6378 #endif
6379  USE w3gdatmd, ONLY: nk, nth, nspec, sig, dth, esin, ecos, nseal, fsbccfl, clats, mapfs
6381  USE w3odatmd, ONLY: ndse, ndst, flbpi, nbi, tbpi0, tbpin, isbpi, bbpi0, bbpin
6382  USE w3adatmd, ONLY: dw, cx, cy, mpi_comm_wcmp
6383  USE w3idatmd, ONLY: flcur, fllev
6384  USE w3wdatmd, ONLY: va
6385  USE w3dispmd, ONLY: wavnu3
6386  USE w3odatmd, ONLY : iaproc
6387 #ifdef W3_PDLIB
6388  USE yowelementpool, only: ne, ine
6389  USE yownodepool, only: np, npa, pdlib_ien, pdlib_si, iplg
6390  use yowdatapool, only: rtype
6392  use yowrankmodule, only: ipgl_npa
6393  USE mpi, only : mpi_min
6394 #endif
6395 #ifdef W3_REF1
6396  USE w3gdatmd, only: refpars
6397 #endif
6398 
6399  IMPLICIT NONE
6400 
6401  LOGICAL, INTENT(IN) :: LCALC
6402 
6403  INTEGER, INTENT(IN) :: IMOD
6404 
6405  REAL, INTENT(IN) :: FACX, FACY, DTG, VGX, VGY
6406 
6407  REAL :: KTMP(3), UTILDE(NTH), ST(NTH,NPA)
6408  REAL :: FL11(NTH), FL12(NTH), FL21(NTH), FL22(NTH), FL31(NTH), FL32(NTH), KKSUM(NTH,NPA)
6409  REAL :: FL111(NTH), FL112(NTH), FL211(NTH), FL212(NTH), FL311(NTH), FL312(NTH)
6410 
6411  REAL :: KSIG(NPA), CGSIG(NPA), CXX(NTH,NPA), CYY(NTH,NPA)
6412  REAL :: LAMBDAX(NTH), LAMBDAY(NTH)
6413  REAL :: DTMAX(NTH), DTMAXEXP(NTH), DTMAXOUT, DTMAXGL
6414  REAL :: FIN(1), FOUT(1), REST, CFLXY, RD1, RD2, RD10, RD20
6415  REAL :: UOLD(NTH,NPA), U(NTH,NPA)
6416 
6417  REAL, PARAMETER :: ONESIXTH = 1.0/6.0
6418  REAL, PARAMETER :: ZERO = 0.0
6419  REAL, PARAMETER :: THR = 1.0e-12
6420 
6421  INTEGER :: IK, ISP, ITH, IE, IP, IT, IBI, NI(3), I1, I2, I3, JX, IERR, IP_GLOB, ISEA
6422  !
6423  ! 1.b Initialize arrays
6424  !
6425  ! 2. Calculate velocities ---------------- *
6426  !
6427  ! 2a. Vectorized for all points looping over each wave number (maybe do a dirty save will be nice!)
6428  !
6429 
6430  DO ik = 1, nk
6431 
6432  IF (lcalc) THEN
6433 
6434  DO ip = 1, npa
6435  CALL wavnu3 (sig(ik), dw(iplg(ip)), ksig(ip), cgsig(ip))
6436  ENDDO
6437 
6438  DO ip = 1, npa
6439  DO ith = 1, nth
6440  isea = iplg(ip)
6441  cxx(ith,ip) = cgsig(ip) * facx * ecos(ith) / clats(isea)
6442  cyy(ith,ip) = cgsig(ip) * facy * esin(ith)
6443  ENDDO ! ith
6444  IF (flcur) THEN
6445  DO ith = 1, nth
6446  isea = iplg(ip)
6447  IF (iobp_loc(ip) .GT. 0) THEN
6448  cxx(ith,ip) = cxx(ith,ip) + facx * cx(isea)/clats(isea)
6449  cyy(ith,ip) = cyy(ith,ip) + facy * cy(isea)
6450  ENDIF
6451  ENDDO !ith
6452  ENDIF
6453  ENDDO
6454 
6455  DO ie = 1, ne
6456 
6457  ni = ine(:,ie)
6458 
6459  i1 = ni(1)
6460  i2 = ni(2)
6461  i3 = ni(3)
6462 
6463  DO ith = 1, nth
6464  lambdax(ith) = onesixth *(cxx(ith,i1)+cxx(ith,i2)+cxx(ith,i3)) ! Linearized advection speed in X and Y direction
6465  lambday(ith) = onesixth *(cyy(ith,i1)+cyy(ith,i2)+cyy(ith,i3))
6466  kelem1(ith,ie,ik) = lambdax(ith) * pdlib_ien(1,ie) + lambday(ith) * pdlib_ien(2,ie) ! K-Values - so called Flux Jacobians
6467  kelem2(ith,ie,ik) = lambdax(ith) * pdlib_ien(3,ie) + lambday(ith) * pdlib_ien(4,ie)
6468  kelem3(ith,ie,ik) = lambdax(ith) * pdlib_ien(5,ie) + lambday(ith) * pdlib_ien(6,ie)
6469  ktmp(1) = kelem1(ith,ie,ik) ! Extract
6470  ktmp(2) = kelem2(ith,ie,ik)
6471  ktmp(3) = kelem3(ith,ie,ik)
6472  nm(ith,ie,ik) = - 1.d0/min(-thr,sum(min(zero,ktmp))) ! N-Values
6473  kelem1(ith,ie,ik) = max(zero,ktmp(1))
6474  kelem2(ith,ie,ik) = max(zero,ktmp(2))
6475  kelem3(ith,ie,ik) = max(zero,ktmp(3))
6476  ENDDO
6477 
6478  fl11 = cxx(:,i2) * pdlib_ien(1,ie) + cyy(:,i2) * pdlib_ien(2,ie) ! Weights for Simpson Integration
6479  fl12 = cxx(:,i3) * pdlib_ien(1,ie) + cyy(:,i3) * pdlib_ien(2,ie)
6480  fl21 = cxx(:,i3) * pdlib_ien(3,ie) + cyy(:,i3) * pdlib_ien(4,ie)
6481  fl22 = cxx(:,i1) * pdlib_ien(3,ie) + cyy(:,i1) * pdlib_ien(4,ie)
6482  fl31 = cxx(:,i1) * pdlib_ien(5,ie) + cyy(:,i1) * pdlib_ien(6,ie)
6483  fl32 = cxx(:,i2) * pdlib_ien(5,ie) + cyy(:,i2) * pdlib_ien(6,ie)
6484 
6485  fl111 = 2.d0 * fl11 + fl12
6486  fl112 = 2.d0 * fl12 + fl11
6487  fl211 = 2.d0 * fl21 + fl22
6488  fl212 = 2.d0 * fl22 + fl21
6489  fl311 = 2.d0 * fl31 + fl32
6490  fl312 = 2.d0 * fl32 + fl31
6491 
6492  flall1(:,ie,ik) = (fl311 + fl212) * onesixth + kelem1(:,ie,ik)
6493  flall2(:,ie,ik) = (fl111 + fl312) * onesixth + kelem2(:,ie,ik)
6494  flall3(:,ie,ik) = (fl211 + fl112) * onesixth + kelem3(:,ie,ik)
6495 
6496  ENDDO ! IE
6497 
6498  kksum = zero
6499  DO ie = 1, ne
6500  ni = ine(:,ie)
6501  DO ith = 1, nth
6502  kksum(ith,ni(1)) = kksum(ith,ni(1)) + kelem1(ith,ie,ik)
6503  kksum(ith,ni(2)) = kksum(ith,ni(2)) + kelem2(ith,ie,ik)
6504  kksum(ith,ni(3)) = kksum(ith,ni(3)) + kelem3(ith,ie,ik)
6505  ENDDO
6506  END DO
6507 
6508  dtmaxexp = 1.e10
6509  dtmax = 1.e10
6510  DO ip = 1, npa
6511  IF (iobp_loc(ip) .EQ. 1 .OR. fsbccfl) THEN
6512  DO ith = 1, nth
6513  dtmaxexp(ith) = pdlib_si(ip)/max(thr,kksum(ith,ip)*iobdp_loc(ip))
6514  dtmax(ith) = min(dtmax(ith),dtmaxexp(ith))
6515  ENDDO
6516  dtmaxout = minval(dtmax)
6517  ENDIF
6518  END DO
6519 
6520  fin(1) = dtmaxout
6521  CALL mpi_allreduce(fin,fout,1,rtype,mpi_min,mpi_comm_wcmp,ierr)
6522  dtmaxgl = fout(1)
6523 
6524  cflxy = dble(dtg)/dtmaxgl
6525  rest = abs(mod(cflxy,1.0d0))
6526  IF (rest .LT. thr) THEN
6527  iter(ik) = abs(nint(cflxy))
6528  ELSE IF (rest .GT. thr .AND. rest .LT. 0.5d0) THEN
6529  iter(ik) = abs(nint(cflxy)) + 1
6530  ELSE
6531  iter(ik) = abs(nint(cflxy))
6532  END IF
6533 
6534  DO ip = 1, npa
6535  dtsi(ip) = dble(dtmaxgl)/dble(iter(ik))/pdlib_si(ip) ! Some precalculations for the time integration.
6536  END DO
6537 
6538  END IF ! LCALC
6539 
6540  ! Exact and convert Wave Action - should be some subroutine function or whatever
6541  do ip = 1,npa
6542  isp = 0
6543  do ith = 1,nth
6544  isp = ith + (ik-1)*nth
6545  u(ith,ip) = va(isp,ip) / cgsig(ip) * clats(iplg(ip))
6546  enddo
6547  enddo
6548  CALL pdlib_exchange2dreal(u)
6549 
6550  DO it = 1, iter(ik)
6551  st = zero
6552  DO ie = 1, ne
6553  ni = ine(:,ie)
6554  DO ith = 1, nth
6555  utilde(ith) = nm(ith,ie,ik) * (flall1(ith,ie,ik)*u(ith,ni(1)) + flall2(ith,ie,ik)*u(ith,ni(2)) + flall3(ith,ie,ik)*u(ith,ni(3)))
6556  st(ith,ni(1)) = st(ith,ni(1)) + kelem1(ith,ie,ik) * (u(ith,ni(1)) - utilde(ith)) ! the 2nd term are the theta values of each node ...
6557  st(ith,ni(2)) = st(ith,ni(2)) + kelem2(ith,ie,ik) * (u(ith,ni(2)) - utilde(ith)) ! the 2nd term are the theta values of each node ...
6558  st(ith,ni(3)) = st(ith,ni(3)) + kelem3(ith,ie,ik) * (u(ith,ni(3)) - utilde(ith)) ! the 2nd term are the theta values of each node ...
6559  ENDDO
6560  END DO ! IE
6561  DO ip = 1, npa
6562  DO ith = 1, nth
6563  u(ith,ip) = max(zero,u(ith,ip)-dtsi(ip)*st(ith,ip)*(1-iobpa_loc(ip)))*iobpd_loc(ith,ip)*iobdp_loc(ip)
6564 #ifdef W3_REF1
6565  IF (refpars(3).LT.0.5.AND.iobpd_loc(ith,ip).EQ.0.AND.iobpa_loc(ip).EQ.0) u(ith,ip) = uold(ith,ip) ! restores reflected boundary values
6566 #endif
6567  ENDDO
6568  ENDDO ! IP
6569 
6570  IF ( flbpi ) THEN
6571  DO ith = 1, nth
6572  isp = ith + (ik-1) * nth
6573  rd1 = rd10 - dtg * real(iter(ik)-it)/real(iter(ik))
6574  rd2 = rd20
6575  IF ( rd2 .GT. 0.001 ) THEN
6576  rd2 = min(1.,max(0.,rd1/rd2))
6577  rd1 = 1. - rd2
6578  ELSE
6579  rd1 = 0.
6580  rd2 = 1.
6581  END IF
6582  DO ibi = 1, nbi
6583  ip_glob = mapsf(isbpi(ibi),1)
6584  jx = ipgl_npa(ip_glob)
6585  IF (jx .gt. 0) THEN
6586  u(ith,jx) = ( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) / cgsig(isbpi(ibi)) * clats(isbpi(ibi))
6587  END IF
6588  END DO
6589  ENDDO
6590  ENDIF ! FLBPI
6591 
6592  CALL pdlib_exchange2dreal(u)
6593 
6594  ENDDO ! IT
6595 
6596  ! Exact and convert Wave Action
6597  do ip = 1,npa
6598  isp = 0
6599  do ith = 1,nth
6600  isp = ith + (ik-1)*nth
6601  va(isp,ip) = u(ith,ip) * cgsig(ip) / clats(iplg(ip))
6602  end do
6603  end do
6604 
6605  ENDDO ! IK
6606 

References w3odatmd::bbpi0, w3odatmd::bbpin, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dth, dtsi, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, flall1, flall2, flall3, w3odatmd::flbpi, w3idatmd::flcur, w3idatmd::fllev, w3gdatmd::fsbccfl, w3odatmd::iaproc, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yowrankmodule::ipgl_npa, yownodepool::iplg, w3odatmd::isbpi, iter, kelem1, kelem2, kelem3, w3gdatmd::mapfs, w3gdatmd::mapsf, w3adatmd::mpi_comm_wcmp, w3odatmd::nbi, w3odatmd::ndse, w3odatmd::ndst, yowelementpool::ne, w3gdatmd::nk, nm, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, yowexchangemodule::pdlib_exchange2dreal(), yowexchangemodule::pdlib_exchange2dreal_zero(), yownodepool::pdlib_ien, yownodepool::pdlib_si, w3gdatmd::refpars, yowdatapool::rtype, w3gdatmd::sig, w3servmd::strace(), w3odatmd::tbpi0, w3odatmd::tbpin, w3wdatmd::va, and w3dispmd::wavnu3().

Referenced by pdlib_w3xypug_block_explicit().

◆ pdlib_init()

subroutine pdlib_w3profsmd::pdlib_init ( integer, intent(in)  IMOD)

Definition at line 144 of file w3profsmd_pdlib.F90.

144  !/
145  !/ +-----------------------------------+
146  !/ | WAVEWATCH III NOAA/NCEP |
147  !/ | |
148  !/ | Aron Roland (BGS IT&E GmbH) |
149  !/ | Mathieu Dutour-Sikiric (IRB) |
150  !/ | |
151  !/ | FORTRAN 90 |
152  !/ | Last update : 01-June-2018 |
153  !/ +-----------------------------------+
154  !/
155  !/ 01-June-2018 : Origination. ( version 6.04 )
156  !/
157  ! 1. Purpose : Init pdlib part
158  ! 2. Method :
159  ! 3. Parameters :
160  !
161  ! Parameter list
162  ! ----------------------------------------------------------------
163  ! ----------------------------------------------------------------
164  !
165  ! 4. Subroutines used :
166  !
167  ! Name Type Module Description
168  ! ----------------------------------------------------------------
169  ! STRACE Subr. W3SERVMD Subroutine tracing.
170  ! ----------------------------------------------------------------
171  !
172  ! 5. Called by :
173  !
174  ! Name Type Module Description
175  ! ----------------------------------------------------------------
176  ! ----------------------------------------------------------------
177  !
178  ! 6. Error messages :
179  ! 7. Remarks
180  ! 8. Structure :
181  ! 9. Switches :
182  !
183  ! !/S Enable subroutine tracing.
184  !
185  ! 10. Source code :
186  !
187  !/ ------------------------------------------------------------------- /
188 #ifdef W3_S
189  USE w3servmd, only: strace
190 #endif
191  !
192  USE w3gdatmd, only: flcx, flcy
193  USE constants, only : grav, tpi
194  USE w3gdatmd, only: xgrd, ygrd, nx, nsea, ntri, trigp, nspec, nseal
195  USE w3gdatmd, only: mapsta, mapfs, grids, nth, sig, nk
197  USE w3gdatmd, only: ccon, countcon, index_cell, ie_cell
198  USE w3gdatmd, only: iobp, iobpa, iobpd, iobdp, si
199 
201  USE w3odatmd, only: iaproc, naproc, ntproc
202  USE yowdatapool, only: istatus
203  USE yowpdlibmain, only: initfromgriddim
204  USE yownodepool, only: npa, np, iplg
205  USE w3parall, only : pdlib_nseal, pdlib_nsealm
206  USE w3parall, only : jx_to_jsea, isea_to_jsea
210 
211  !/
212  include "mpif.h"
213  !/
214  !/ ------------------------------------------------------------------- /
215  !/ Parameter list
216  !/
217  !/ ------------------------------------------------------------------- /
218  !/ Local PARAMETERs
219  !/
220 #ifdef W3_S
221  INTEGER, SAVE :: IENT = 0
222 #endif
223  !/
224  !/ ------------------------------------------------------------------- /
225  !/
226  !! INCLUDE "mpif.h"
227  INTEGER :: istat
228  INTEGER :: I, J, IBND_MAP, ISEA, IP, IX, JSEA, nb
229  INTEGER :: IP_glob
230  INTEGER :: myrank, ierr, iproc
231  INTEGER, ALLOCATABLE :: NSEAL_arr(:)
232  INTEGER :: IERR_MPI
233  INTEGER :: IScal(1)
234  INTEGER, INTENT(in) :: IMOD
235  INTEGER :: IK, ISP
236  INTEGER IK0, ISP0, ITH
237  REAL :: eSIG, eFR
238  REAL, PARAMETER :: COEF4 = 5.0e-7
239 #ifdef W3_S
240  CALL strace (ient, 'PDLIB_INIT')
241 #endif
242 #ifdef W3_DEBUGSOLVER
243  WRITE(740+iaproc,*) 'PDLIB_INIT, IMOD (no print)'
244  WRITE(740+iaproc,*) 'NAPROC=', naproc
245  WRITE(740+iaproc,*) 'NTPROC=', ntproc
246  FLUSH(740+iaproc)
247 #endif
248 
249  pdlib_nseal = 0
250 
251  IF (iaproc .le. naproc) THEN
252 
253  CALL mpi_comm_rank(mpi_comm_wcmp, myrank, ierr)
254  !
255 #ifdef W3_DEBUGSOLVER
256  WRITE(740+iaproc,*) 'PDLIB_INIT, IAPROC=', iaproc
257  WRITE(740+iaproc,*) 'PDLIB_INIT, NAPROC=', naproc
258  WRITE(740+iaproc,*) 'PDLIB_INIT, myrank=', myrank
259  FLUSH(740+iaproc)
260 #endif
261  !
262  IF (fstotalexp) THEN
263  CALL initfromgriddim(nx,ntri,trigp,nth,mpi_comm_wcmp)
264  ELSE
265  CALL initfromgriddim(nx,ntri,trigp,nspec,mpi_comm_wcmp)
266  ENDIF
267  !
268 #ifdef W3_DEBUGSOLVER
269  WRITE(740+iaproc,*) 'After initFromGridDim'
270  FLUSH(740+iaproc)
271 #endif
272  !
273  !
274  ! Now the computation of NSEAL
275  !
276  !
277  DO ip = 1, npa
278  ix = iplg(ip)
279  isea = mapfs(1,ix)
280  IF (isea .gt. 0) pdlib_nseal = pdlib_nseal + 1
281  END DO
282 #ifdef W3_DEBUGSOLVER
283  WRITE(740+iaproc,*) 'npa is augmented domain over NX'
284  WRITE(740+iaproc,*) 'PDLIB_NSEAL is basicall npa but only over the wet points'
285  WRITE(740+iaproc,*) 'NSEAL is set to PDLIB_NSEAL'
286  WRITE(740+iaproc,*) 'PDLIB_NSEAL=', pdlib_nseal
287  WRITE(740+iaproc,*) 'NSEAL =', nseal, 'NP =', np, 'NPA =', npa
288  FLUSH(740+iaproc)
289 #endif
290  ALLOCATE(jx_to_jsea(npa), isea_to_jsea(nsea), stat=istat)
291 #ifdef W3_DEBUGSOLVER
292  WRITE(740+iaproc,*) 'ISEA_TO_JSEA ALLOCATEd'
293  FLUSH(740+iaproc)
294 #endif
295  if(istat /= 0) CALL pdlib_abort(3)
296  jsea = 0
297  jx_to_jsea = 0
298  isea_to_jsea = 0
299  DO ip = 1, npa
300  ix = iplg(ip)
301  isea = mapfs(1,ix)
302  IF (isea .gt. 0) THEN
303  jsea=jsea+1
304  jx_to_jsea(ip)=jsea
305  isea_to_jsea(isea)=jsea
306  END IF
307  END DO
308  !
309 #ifdef W3_DEBUGSOLVER
310  WRITE(740+iaproc,*) 'After JX_TO_JSEA, ISEA_TO_JSEA and friend computation'
311  FLUSH(740+iaproc)
312 #endif
313  !
314  ! Map a point in (1:PDLIB_NSEAL) to a point in (1:NSEA)
315  !
316  nb=0
317  DO ix=1,nx
318  IF (mapfs(1,ix) .gt. 0) nb = nb + 1
319  END DO
320 
321  IF (nb .ne. nsea) THEN
322  WRITE(*,*) 'Logical error in computation of NSEA / nb'
323  WRITE(*,*) 'nb=', nb, ' NSEA=', nsea
324  stop
325  END IF
326 #ifdef W3_DEBUGSOLVER
327  WRITE(740+iaproc,*) 'nb / NSEA consistency check'
328  FLUSH(740+iaproc)
329 #endif
330  END IF
331  fsgeoadvect = .false.
332  IF ((flcx .eqv. .true.).and.(flcy .eqv. .true.)) THEN
333  fsgeoadvect =.true.
334  END IF
335  !
336  ! Compute NSEALM
337  !
338  IF (iaproc .le. naproc) THEN
339  IF (iaproc .eq. 1) THEN
340  ALLOCATE(nseal_arr(naproc))
341  nseal_arr(1)=pdlib_nseal
342  DO iproc=2,naproc
343  CALL mpi_recv(iscal,1,mpi_int, iproc-1, 23, mpi_comm_wave, istatus, ierr_mpi)
344  nseal_arr(iproc)=iscal(1)
345  END DO
346  pdlib_nsealm=maxval(nseal_arr)
347  DEALLOCATE(nseal_arr)
348  ELSE
349  iscal(1)=pdlib_nseal
350  CALL mpi_send(iscal,1,mpi_int, 0, 23, mpi_comm_wave, ierr_mpi)
351  END IF
352  END IF
353  !
354  IF (iaproc .eq. 1) THEN
355  iscal(1)=pdlib_nsealm
356  DO iproc = 2 , ntproc
357  CALL mpi_send(iscal,1,mpi_int, iproc-1, 24, mpi_comm_wave, ierr_mpi)
358  END DO
359  ELSE
360  CALL mpi_recv(iscal,1,mpi_int, 0, 24, mpi_comm_wave, istatus, ierr_mpi)
361  pdlib_nsealm=iscal(1)
362  END IF
363 
364 #ifdef W3_DEBUGINIT
365  WRITE(740+iaproc,*) 'ALLOCATEd(ISEA_TO_JSEA)=', allocated(isea_to_jsea)
366  WRITE(740+iaproc,*) 'PDLIB_NSEALM=', pdlib_nsealm
367  FLUSH(740+iaproc)
368 #endif
369  !
371  ALLOCATE(cofrm4(nk))
372  DO ik=1,nk
373  esig=sig(ik)
374  efr=esig/tpi
375  cofrm4(ik)=coef4*grav/(efr**4)
376  END DO
377  ALLOCATE(is0_pdlib(nspec))
378  DO isp=1, nspec
379  is0_pdlib(isp) = isp - 1
380  END DO
381  DO isp=1, nspec, nth
382  is0_pdlib(isp) = is0_pdlib(isp) + nth
383  END DO
384 
385  DO jsea=1, pdlib_nseal
386  ip = jsea
387  ip_glob = iplg(ip)
388  isea = mapfs(1,ip_glob)
389  IF (isea .ne. ip_glob) THEN
390  WRITE(*,*) jsea, pdlib_nseal, ip, ip_glob, isea
391  WRITE(*,*) .ne.'ISEA IP_glob'
392  CALL pdlib_abort(20)
393  ENDIF
394  ENDDO
395  !
396  !
397  !/
398  !/ End of PDLIB_INIT ------------------------------------------- /
399  !/

References w3gdatmd::ccon, cofrm4, yowfunction::computelistnp_listnpa_listiplg(), w3gdatmd::countcon, w3gdatmd::flcx, w3gdatmd::flcy, w3gdatmd::fsfct, w3gdatmd::fsfreqshift, fsgeoadvect, w3gdatmd::fsn, w3gdatmd::fsnimp, w3gdatmd::fspsi, w3gdatmd::fsrefraction, w3gdatmd::fssource, w3gdatmd::fstotalexp, w3gdatmd::fstotalimp, constants::grav, w3gdatmd::grids, w3odatmd::iaproc, w3gdatmd::ie_cell, include(), w3gdatmd::index_cell, yowpdlibmain::initfromgriddim(), w3gdatmd::iobdp, w3gdatmd::iobdp_loc, w3gdatmd::iobp, w3gdatmd::iobp_loc, w3gdatmd::iobpa, w3gdatmd::iobpa_loc, w3gdatmd::iobpd, w3gdatmd::iobpd_loc, yownodepool::iplg, is0_pdlib, w3parall::isea_to_jsea, yowdatapool::istatus, w3parall::jx_to_jsea, w3gdatmd::mapfs, w3gdatmd::mapsta, w3adatmd::mpi_comm_wave, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3odatmd::ntproc, w3gdatmd::ntri, w3gdatmd::nx, yowfunction::pdlib_abort(), w3parall::pdlib_nseal, w3parall::pdlib_nsealm, w3gdatmd::si, w3gdatmd::sig, w3servmd::strace(), constants::tpi, w3gdatmd::trigp, w3gdatmd::xgrd, and w3gdatmd::ygrd.

Referenced by w3initmd::w3init().

◆ pdlib_iobp_init()

subroutine pdlib_w3profsmd::pdlib_iobp_init ( integer, intent(in)  IMOD)

Definition at line 518 of file w3profsmd_pdlib.F90.

518  !/
519  !/ +-----------------------------------+
520  !/ | WAVEWATCH III NOAA/NCEP |
521  !/ | |
522  !/ | Aron Roland (BGS IT&E GmbH) |
523  !/ | Mathieu Dutour-Sikiric (IRB) |
524  !/ | |
525  !/ | FORTRAN 90 |
526  !/ | Last update : 01-June-2018 |
527  !/ +-----------------------------------+
528  !/
529  !/ 01-June-2018 : Origination. ( version 6.04 )
530  !/
531  ! 1. Purpose : Init mapsta part for pdlib
532  ! 2. Method :
533  ! 3. Parameters :
534  !
535  ! Parameter list
536  ! ----------------------------------------------------------------
537  ! ----------------------------------------------------------------
538  !
539  ! 4. Subroutines used :
540  !
541  ! Name Type Module Description
542  ! ----------------------------------------------------------------
543  ! STRACE Subr. W3SERVMD Subroutine tracing.
544  ! ----------------------------------------------------------------
545  !
546  ! 5. Called by :
547  !
548  ! Name Type Module Description
549  ! ----------------------------------------------------------------
550  ! ----------------------------------------------------------------
551  !
552  ! 6. Error messages :
553  ! 7. Remarks
554  ! 8. Structure :
555  ! 9. Switches :
556  !
557  ! !/S Enable subroutine tracing.
558  !
559  ! 10. Source code :
560  !
561  !/ ------------------------------------------------------------------- /
562 #ifdef W3_S
563  USE w3servmd, only: strace
564 #endif
565  !
566  USE w3gdatmd, only : index_map, nbnd_map, nsea, nseal, grids, nx, nth
567  USE w3gdatmd, only : iobp, iobdp, iobpa, iobpd, nbnd_map, index_map
569  USE w3odatmd, only : iaproc, naproc
570  USE yownodepool, only: iplg, npa
571  USE yowfunction, only: pdlib_abort
572  USE w3odatmd, only: iaproc
573  !/
574  !/
575  !/ ------------------------------------------------------------------- /
576  !/ Parameter list
577  !/
578  !/ ------------------------------------------------------------------- /
579  !/ Local PARAMETERs
580  !/
581 #ifdef W3_S
582  INTEGER, SAVE :: IENT = 0
583 #endif
584  !/
585  !/ ------------------------------------------------------------------- /
586  !/
587  INTEGER :: IBND_MAP, ISEA, JSEA, IX, IP, IP_glob
588  INTEGER, INTENT(in) :: IMOD
589  INTEGER :: Status(NX), istat
590  REAL :: rtmp(nseal)
591 #ifdef W3_S
592  CALL strace (ient, 'PDLIB_MAPSTA_INIT')
593 #endif
594 #ifdef W3_DEBUGINIT
595  WRITE(*,*) 'Passing by PDLIB_MAPSTA_INIT IAPROC=', iaproc
596 #endif
597  IF (iaproc .gt. naproc) THEN
598  RETURN
599  END IF
600 
601  ALLOCATE(grids(imod)%IOBP_LOC(npa), stat=istat)
602  if(istat /= 0) CALL pdlib_abort(7)
603  ALLOCATE(grids(imod)%IOBPD_LOC(nth,npa), stat=istat)
604  if(istat /= 0) CALL pdlib_abort(8)
605  ALLOCATE(grids(imod)%IOBDP_LOC(npa), stat=istat)
606  if(istat /= 0) CALL pdlib_abort(9)
607  ALLOCATE(grids(imod)%IOBPA_LOC(npa), stat=istat)
608  if(istat /= 0) CALL pdlib_abort(9)
609 
610  iobp_loc => grids(imod)%IOBP_LOC
611  iobpa_loc => grids(imod)%IOBPA_LOC
612  iobpd_loc => grids(imod)%IOBPD_LOC
613  iobdp_loc => grids(imod)%IOBDP_LOC
614 
615  DO ip = 1, npa
616  ip_glob = iplg(ip)
617  iobp_loc(ip) = iobp(ip_glob)
618  iobpd_loc(:,ip) = iobpd(:,ip_glob)
619  END DO
620 
621  iobdp_loc = 0
622  iobp => null()
623  iobpd => null()
624  DEALLOCATE(grids(imod)%IOBP,grids(imod)%IOBPD)
625  CALL set_iobpa_pdlib
626  !/
627  !/ End of W3SPR4 ----------------------------------------------------- /
628  !/

References w3gdatmd::grids, w3odatmd::iaproc, w3gdatmd::index_map, w3gdatmd::iobdp, w3gdatmd::iobdp_loc, w3gdatmd::iobp, w3gdatmd::iobp_loc, w3gdatmd::iobpa, w3gdatmd::iobpa_loc, w3gdatmd::iobpd, w3gdatmd::iobpd_loc, yownodepool::iplg, w3odatmd::naproc, w3gdatmd::nbnd_map, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nth, w3gdatmd::nx, yowfunction::pdlib_abort(), set_iobpa_pdlib(), and w3servmd::strace().

Referenced by w3initmd::w3init().

◆ pdlib_jacobi_gauss_seidel_block()

subroutine pdlib_w3profsmd::pdlib_jacobi_gauss_seidel_block ( integer, intent(in)  IMOD,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  DTG,
real, intent(in)  VGX,
real, intent(in)  VGY,
logical, intent(in)  LCALC 
)

Definition at line 5446 of file w3profsmd_pdlib.F90.

5446  !/
5447  !/ +-----------------------------------+
5448  !/ | WAVEWATCH III NOAA/NCEP |
5449  !/ | |
5450  !/ | Aron Roland (BGS IT&E GmbH) |
5451  !/ | Mathieu Dutour-Sikiric (IRB) |
5452  !/ | |
5453  !/ | FORTRAN 90 |
5454  !/ | Last update : 01-June-2018 |
5455  !/ +-----------------------------------+
5456  !/
5457  !/ 01-June-2018 : Origination. ( version 6.04 )
5458  !/
5459  ! 1. Purpose : Block Gauss Seidel and Jacobi solver
5460  ! 2. Method :
5461  ! 3. Parameters :
5462  !
5463  ! Parameter list
5464  ! ----------------------------------------------------------------
5465  ! ----------------------------------------------------------------
5466  !
5467  ! 4. Subroutines used :
5468  !
5469  ! Name Type Module Description
5470  ! ----------------------------------------------------------------
5471  ! STRACE Subr. W3SERVMD Subroutine tracing.
5472  ! ----------------------------------------------------------------
5473  !
5474  ! 5. Called by :
5475  !
5476  ! Name Type Module Description
5477  ! ----------------------------------------------------------------
5478  ! ----------------------------------------------------------------
5479  !
5480  ! 6. Error messages :
5481  ! 7. Remarks
5482  ! 8. Structure :
5483  ! 9. Switches :
5484  !
5485  ! !/S Enable subroutine tracing.
5486  !
5487  ! 10. Source code :
5488  !
5489  !/ ------------------------------------------------------------------- /
5490  !
5491 #ifdef W3_S
5492  USE w3servmd, only: strace
5493 #endif
5494  !/
5495  USE constants, only : tpi, tpiinv, grav
5496  USE w3gdatmd, only: mapsta
5501  USE w3gdatmd, only: mapwn
5502 #ifdef W3_DEBUGSRC
5503  USE w3gdatmd, only: optioncall
5504  USE w3wdatmd, only: shavetot
5505 #endif
5508  use yowdatapool, only: rtype
5509  use yownodepool, only: npa, iplg
5511  USE mpi, only : mpi_sum, mpi_int
5512  USE w3adatmd, only: mpi_comm_wcmp
5513  USE w3gdatmd, only: nsea, sig, facp, flsou
5515  USE w3gdatmd, only: nk, nk2, nth, ecos, esin, nspec, mapfs, nsea, sig
5516  USE w3wdatmd, only: time
5517  USE w3odatmd, only: nbi
5518  USE w3timemd, only: dsec21
5519  USE w3gdatmd, only: nseal, clats, fachfa
5520  USE w3idatmd, only: flcur, fllev
5521  USE w3wdatmd, only: va, vaold, vstot, vdtot, ust
5522  USE w3adatmd, only: cg, cx, cy, wn, dw
5523  USE w3odatmd, only: tbpin, flbpi, iaproc
5524  USE w3parall, only : imem
5527  USE w3parall, only : jx_to_jsea
5529  USE yowfunction, only : pdlib_abort
5530  USE yownodepool, only: np_global
5531  USE w3dispmd, only : wavnu_local
5532  USE w3adatmd, ONLY: u10, u10d
5533 #ifdef W3_ST4
5534  USE w3src4md, only: w3spr4
5535 #endif
5536 #ifdef W3_REF1
5537  USE w3gdatmd, only: refpars
5538 #endif
5539  implicit none
5540  LOGICAL, INTENT(IN) :: LCALC
5541  INTEGER, INTENT(IN) :: IMOD
5542  REAL, INTENT(IN) :: FACX, FACY, DTG, VGX, VGY
5543  !
5544  INTEGER :: IP, ISP, ITH, IK, JSEA, ISEA, IP_glob, IS0
5545  INTEGER :: myrank
5546  INTEGER :: nbIter, ISPnextDir, ISPprevDir
5547  INTEGER :: ISPp1, ISPm1, JP, ICOUNT1, ICOUNT2
5548  ! for the exchange
5549  real*8 :: ccos, csin, ccurx, ccury
5550  real*8 :: esum(nspec), frlocal
5551  real*8 :: ea_the, ec_the, ea_sig, ec_sig, esi
5552  real*8 :: cad(nspec), cas(nspec), acloc(nspec)
5553  real*8 :: cp_sig(nspec), cm_sig(nspec)
5554  real*8 :: efactm1, efactp1
5555  real*8 :: sum_prev, sum_new, p_is_converged, diffnew, prop_conv
5556  real*8 :: sum_l2, sum_l2_gl
5557  REAL :: DMM(0:NK2), DAM(NSPEC), DAM2(NSPEC), SPEC(NSPEC)
5558  real*8 :: ediff(nspec), eprod(nspec), ediffb(nspec)
5559  real*8 :: dwni_m2(nk), cwnb_m2(1-nth:nspec)
5560  REAL :: VAnew(NSPEC), VFLWN(1-NTH:NSPEC), JAC, JAC2
5561  REAL :: VAAnew(1-NTH:NSPEC+NTH), VAAacloc(1-NTH:NSPEC+NTH)
5562  REAL :: VAinput(NSPEC), VAacloc(NSPEC), ASPAR_DIAG(NSPEC)
5563  REAL :: aspar_diag_local(nspec), aspar_off_diag_local(nspec), b_jac_local(nspec)
5564  real*8 :: ediffsing, esumpart
5565  REAL :: EMEAN, FMEAN, FMEAN1, WNMEAN, AMAX, U10ABS, U10DIR, TAUA, TAUADIR
5566  REAL :: USTAR, USTDIR, TAUWX, TAUWY, CD, Z0, CHARN, FMEANWS, DLWMEAN
5567  real*8 :: eval1, eval2
5568  real*8 :: eva, evo, cg2, newdac, newac, oldac, maxdac
5569  REAL :: CG1(0:NK+1), WN1(0:NK+1)
5570  LOGICAL :: LCONVERGED(NSEAL), lexist, LLWS(NSPEC)
5571 #ifdef WEIGHTS
5572  INTEGER :: ipiter(nseal), ipitergl(np_global), ipiterout(np_global)
5573 #endif
5574 #ifdef W3_DEBUGSRC
5575  REAL :: IntDiff, eVA_w3srce, eVAsolve, SumACout
5576  REAL :: SumVAin, SumVAout, SumVAw3srce, SumVS, SumVD, VS_w3srce
5577  REAL :: VAsolve(NSPEC)
5578  real*8 :: acsolve
5579  REAL :: eB
5580 #endif
5581 #ifdef W3_DEBUGSOLVERCOH
5582  REAL :: TheARR(NSPEC, npa)
5583  REAL :: PRE_VA(NSPEC, npa)
5584  REAL :: OffDIAG(NSPEC, npa)
5585  real*8 :: eoff(nspec)
5586  real*8 :: esum1(nspec), esum2(nspec)
5587 #endif
5588  CHARACTER(len=128) eFile
5589  INTEGER ierr, i
5590  INTEGER JP_glob
5591  INTEGER is_converged, itmp
5592 
5593  INTEGER :: TESTNODE = 923
5594 
5595  LOGICAL :: LSIG = .false.
5596 
5597  memunit = 50000+iaproc
5598  !AR: this is missing in init ... but there is a design error in ww3_grid with FLCUR and FLLEV
5599  lsig = flcur .OR. fllev
5600 #ifdef W3_DEBUGSOLVERCOH
5601  offdiag = zero
5602 #endif
5603  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 0')
5604 
5605 
5606  ccurx = facx
5607  ccury = facy
5608  CALL mpi_comm_rank(mpi_comm_wcmp, myrank, ierr)
5609  !
5610 #ifdef W3_DEBUGSOLVER
5611  WRITE(740+iaproc,*) 'PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK, begin'
5612  WRITE(740+iaproc,*) 'NX=', nx
5613  WRITE(740+iaproc,*) 'NP=', np
5614  WRITE(740+iaproc,*) 'NPA=', npa
5615  WRITE(740+iaproc,*) 'NSEA=', nsea
5616  WRITE(740+iaproc,*) 'NSEAL=', nseal
5617  WRITE(740+iaproc,*) 'NBI=', nbi
5618  WRITE(740+iaproc,*) 'B_JGS_TERMINATE_NORM=', b_jgs_terminate_norm
5619  WRITE(740+iaproc,*) 'B_JGS_TERMINATE_DIFFERENCE=', b_jgs_terminate_difference
5620  WRITE(740+iaproc,*) 'B_JGS_TERMINATE_MAXITER=', b_jgs_terminate_maxiter
5621  WRITE(740+iaproc,*) 'B_JGS_MAXITER=', b_jgs_maxiter
5622  WRITE(740+iaproc,*) 'B_JGS_BLOCK_GAUSS_SEIDEL=', b_jgs_block_gauss_seidel
5623  WRITE(740+iaproc,*) 'FSREFRACTION=', fsrefraction
5624  WRITE(740+iaproc,*) 'FSFREQSHIFT=', fsfreqshift
5625  WRITE(740+iaproc,*) 'B_JGS_LIMITER=', b_jgs_limiter
5626  WRITE(740+iaproc,*) 'B_JGS_BLOCK_GAUSS_SEIDEL=', b_jgs_block_gauss_seidel
5627  FLUSH(740+iaproc)
5628 #endif
5629 #ifdef W3_DEBUGSRC
5630  WRITE(740+iaproc,*) 'optionCall=', optioncall
5631  FLUSH(740+iaproc)
5632 #endif
5633  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 1')
5634  !
5635  ! 2. Convert to Wave Action ---------------- *
5636  !
5637 #ifdef W3_DEBUGSRC
5638  WRITE(740+iaproc,*) 'NSEAL =', nseal, 'NP =', np, 'NPA =', npa
5639 #endif
5640 #ifdef W3_DEBUGSOLVERCOH
5641  CALL all_va_integral_print(imod, "VA(np) before transform", 0)
5642  CALL all_va_integral_print(imod, "VA(npa) before transform", 1)
5643 #endif
5644  DO jsea=1,nseal
5645  ip = jsea
5646  ip_glob = iplg(ip)
5647  isea = mapfs(1,ip_glob)
5648  DO isp=1,nspec
5649  ith = 1 + mod(isp-1,nth)
5650  ik = 1 + (isp-1)/nth
5651 #ifdef NOCGTABLE
5652  CALL wavnu_local(sig(ik),dw(isea),wn1(ik),cg1(ik))
5653 #else
5654  cg1(ik) = cg(ik,isea)
5655 #endif
5656  va(isp,jsea) = va(isp,jsea) / cg1(ik) * clats(isea)
5657  END DO
5658  END DO
5659  vaold = va(1:nspec,1:nseal)
5660 
5661 #ifdef W3_DEBUGSRC
5662  DO jsea=1,nseal
5663  WRITE(740+iaproc,*) 'JSEA=', jsea
5664  WRITE(740+iaproc,*) 'min/max/sum(VA)=', minval(va(:,jsea)), maxval(va(:,jsea)), sum(va(:,jsea))
5665  END DO
5666 #endif
5667 
5668 #ifdef W3_DEBUGSOLVERCOH
5669  CALL all_va_integral_print(imod, "VA(np) just defined", 0)
5670  CALL all_va_integral_print(imod, "VA(npa) just defined", 1)
5671 #endif
5672 
5673 #ifdef W3_DEBUGSOLVER
5674  FLUSH(740+iaproc)
5675  WRITE(740+iaproc,*) 'JACOBI_SOLVER, step 4'
5676  WRITE(740+iaproc,*) 'FSSOURCE=', fssource
5677  WRITE(740+iaproc,*) 'FSREFRACTION=', fsrefraction
5678  WRITE(740+iaproc,*) 'FSFREQSHIFT=', fsfreqshift
5679  WRITE(740+iaproc,*) 'FSGEOADVECT=', fsgeoadvect
5680  WRITE(740+iaproc,*) 'DTG=', dtg
5681 #endif
5682  !
5683  ! init matrix and right hand side
5684  !
5685  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 2')
5686  !
5687  IF (.not. lsloc) THEN
5688  IF (imem == 1) THEN
5689  aspar_jac = zero
5690  ELSE IF (imem == 2) THEN
5691  aspar_diag_all = zero
5692  ENDIF
5693  b_jac = zero
5694  ENDIF
5695  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 3')
5696  !
5697  ! source terms
5698  !
5699  IF (fssource) THEN
5700  IF (.not. lsloc) THEN
5701  IF (imem == 1) THEN
5702  call calcarray_jacobi_source_1(dtg)
5703  ELSE IF (imem == 2) THEN
5704  call calcarray_jacobi_source_2(dtg,aspar_diag_all)
5705  ENDIF
5706  ENDIF
5707  END IF
5708  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 4')
5709  !
5710  ! geographical advection
5711  !
5712  IF (imem == 1) THEN
5713  call calcarray_jacobi_vec(dtg,facx,facy,vgx,vgy)
5714  ENDIF
5715 
5716 #ifdef W3_DEBUGSOLVER
5717  WRITE(740+iaproc,'(A20,20E20.10)') 'SUM BJAC 1', sum(b_jac), sum(aspar_jac)
5718 #endif
5719  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 5')
5720  !
5721 #ifdef W3_DEBUGSOLVER
5722  WRITE(740+iaproc,'(A20,20E20.10)') 'SUM BJAC 1', sum(b_jac), sum(aspar_jac)
5723 #endif
5724  !
5725  ! spectral advection
5726  !
5727  IF (fsfreqshift .or. fsrefraction) THEN
5728  IF (imem == 1) THEN
5729  call calcarray_jacobi_spectral_1(dtg)
5730  ELSE IF (imem == 2) THEN
5731  call calcarray_jacobi_spectral_2(dtg,aspar_diag_all)
5732  ENDIF
5733  END IF
5734  CALL apply_boundary_condition(imod)
5735  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION 6')
5736  !
5737 #ifdef W3_DEBUGSOLVERCOH
5738  CALL check_array_integral_nx_r8(b_jac, "B_JAC after calcARRAY", np)
5739  DO ip=1,npa
5740  thearr(:, ip)=real(aspar_jac(:, pdlib_i_diag(ip)))
5741  END DO
5742  CALL check_array_integral_nx_r8(thearr, "ASPAR diag after calArr", np)
5743 #endif
5744  nbiter=0
5745  do ip = 1, np
5746  lconverged(ip) = .false.
5747 #ifdef WEIGHTS
5748  ipiter(ip) = 0
5749 #endif
5750  enddo
5751  !
5752  DO
5753 
5754  is_converged = 0
5755 
5756  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 1')
5757 
5758  DO ip = 1, np
5759 
5760  ip_glob = iplg(ip)
5761  isea = mapfs(1,ip_glob)
5762  IF (iobdp_loc(ip) .eq. 0) THEN
5763  is_converged = is_converged + 1
5764  lconverged(ip) = .true.
5765  cycle
5766  ENDIF
5767 
5768  DO ik = 0, nk + 1
5769 #ifdef NOCGTABLE
5770  CALL wavnu_local(sig(ik),dw(isea),wn1(ik),cg1(ik))
5771 #else
5772  cg1(ik) = cg(ik,isea)
5773  wn1(ik) = wn(ik,isea)
5774 #endif
5775  ENDDO
5776 
5777  jsea = jx_to_jsea(ip)
5778  isea = mapfs(1,ip_glob)
5779  esi = pdlib_si(ip)
5780  acloc = va(:,jsea)
5781 
5782  IF (.NOT. lconverged(ip)) THEN
5783 #ifdef WEIGHTS
5784  ipiter(ip) = ipiter(ip) + 1
5785 #endif
5786 #ifdef W3_DEBUGFREQSHIFT
5787  WRITE(740+iaproc,*) 'Begin loop'
5788  WRITE(740+iaproc,*) 'IP/IP_glob/ISEA/JSEA=', ip, ip_glob, isea, jsea
5789 #endif
5790 #ifdef W3_DEBUGSRC
5791  WRITE(740+iaproc,*) 'IP=', ip, ' IP_glob=', ip_glob
5792  WRITE(740+iaproc,*) 'sum(VA)in=', sum(va(:,ip))
5793 #endif
5794 #ifdef W3_DEBUGFREQSHIFT
5795  DO isp=1,nspec
5796  vaold(isp) = va(isp,jsea)
5797  ik=mapwn(isp)
5798  vainput(isp) = dble(cg(ik,isea)/clats(isea)) * va(isp, ip)
5799  vaacloc(isp) = dble(cg(ik,isea)/clats(isea)) * acloc(isp)
5800  END DO
5801  WRITE(740+iaproc,*) 'sum(VAold/VAinput/VAacloc)=', sum(vaold), sum(vainput), sum(vaacloc)
5802 #endif
5803 
5804  sum_prev = sum(acloc)
5805 
5806  IF (imem == 2) THEN
5807  CALL calcarray_jacobi4(ip,dtg,facx,facy,vgx,vgy,aspar_diag_local,aspar_off_diag_local,b_jac_local)
5808  aspar_diag(1:nspec) = aspar_diag_local(1:nspec) + aspar_diag_all(1:nspec,ip)
5809  esum = b_jac_local - aspar_off_diag_local + b_jac(1:nspec,ip)
5810  ELSEIF (imem == 1) THEN
5811  esum(1:nspec) = b_jac(1:nspec,ip)
5812  aspar_diag(1:nspec) = aspar_jac(1:nspec,pdlib_i_diag(ip))
5813 #ifdef W3_DEBUGFREQSHIFT
5814  WRITE(740+iaproc,*) 'eSI=', esi
5815  WRITE(740+iaproc,*) 'sum(ASPAR_DIAG)=', sum(aspar_diag)
5816 #endif
5817 #ifdef W3_DEBUGSRC
5818  WRITE(740+iaproc,*) 'Step 1: sum(eSum)=', sum(esum)
5819 #endif
5820 #ifdef W3_DEBUGSOLVERCOH
5821  eoff=zero
5822 #endif
5823  DO i = pdlib_ia_p(ip)+1, pdlib_ia_p(ip+1)
5824  jp = pdlib_ja(i)
5825  IF (jp .ne. ip) THEN
5826  eprod(1:nspec) = aspar_jac(1:nspec,i) * va(1:nspec,jp)
5827  esum(1:nspec) = esum(1:nspec) - eprod(1:nspec)
5828 #ifdef W3_DEBUGSOLVERALL
5829  WRITE(740+iaproc,'(A20,3I10,20E20.10)') 'OFF DIAGONAL', ip, i, jp, sum(b_jac(:,ip)), sum(esum), sum(aspar_jac(:,i)), sum(va(:,jp))
5830 #endif
5831 #ifdef W3_DEBUGSOLVERCOH
5832  eoff=eoff + abs(aspar_jac(:,i))
5833 #endif
5834  END IF
5835  END DO
5836  ENDIF ! IMEM
5837 
5838 #ifdef W3_DEBUGSOLVERCOH
5839  offdiag(:, ip)=real(eoff)
5840 #endif
5841 #ifdef W3_DEBUGSOLVERCOHALL
5842  WRITE(740+iaproc,*) 'Step 2: sum(eSum)=', sum(esum), ' eOff=', sum(eoff)
5843 #endif
5844  IF (fsrefraction) THEN
5845 #ifdef W3_DEBUGREFRACTION
5846  WRITE(740+iaproc,*) 'Adding refraction terms to eSum'
5847 #endif
5848  cad = cad_the(:,ip)
5849  DO isp=1,nspec
5850  ispprevdir=listispprevdir(isp)
5851  ispnextdir=listispnextdir(isp)
5852  ea_the = - dtg*esi*max(zero,cad(ispprevdir))
5853  ec_the = dtg*esi*min(zero,cad(ispnextdir))
5854  esum(isp) = esum(isp) - ea_the * va(ispprevdir,ip)
5855  esum(isp) = esum(isp) - ec_the * va(ispnextdir,ip)
5856  END DO
5857  END IF
5858 #ifdef W3_DEBUGSRC
5859  WRITE(740+iaproc,*) 'Step 3: sum(eSum)=', sum(esum)
5860 #endif
5861  IF (fsfreqshift .and. lsig) THEN
5862  IF (freqshiftmethod .eq. 1) THEN
5863  cas = cas_sig(:,ip)
5864  cp_sig = max(zero,cas)
5865  cm_sig = min(zero,cas)
5866  DO ik=0, nk
5867  dmm(ik+1) = dble(wn1(ik+1) - wn1(ik))
5868  END DO
5869  dmm(nk+2) = zero
5870  dmm(0)=dmm(1)
5871  DO ith=1,nth
5872  DO ik=2,nk
5873  isp = ith + (ik -1)*nth
5874  ispm1 = ith + (ik-1 -1)*nth
5875  efactm1 = cg1(ik-1) / cg1(ik)
5876  ea_sig = - esi * cp_sig(ispm1)/dmm(ik-1) * efactm1
5877  esum(isp) = esum(isp) - ea_sig*va(ispm1,ip)
5878  END DO
5879  DO ik=1,nk-1
5880  isp = ith + (ik -1)*nth
5881  ispp1 = ith + (ik+1 -1)*nth
5882  efactp1 = cg1(ik+1) / cg1(ik)
5883  ec_sig = esi * cm_sig(ispp1)/dmm(ik) * efactp1
5884  esum(isp) = esum(isp) - ec_sig*va(ispp1,ip)
5885  END DO
5886  END DO
5887  ELSE IF (freqshiftmethod .eq. 2) THEN
5888  cwnb_m2=cwnb_sig_m2(:,ip)
5889  DO ik=1, nk
5890  dwni_m2(ik) = dble( cg1(ik) / dsip(ik) )
5891  END DO
5892 #ifdef W3_DEBUGFREQSHIFT
5893  WRITE(740+iaproc,*) 'Before FreqShift oper eSum=', sum(abs(esum))
5894 #endif
5895  DO ith=1,nth
5896  DO ik=2,nk
5897  isp = ith + (ik -1)*nth
5898  ispm1 = ith + (ik-1 -1)*nth
5899  efactm1 = dble( cg1(ik-1) / cg1(ik) )
5900  ea_sig = - esi * dwni_m2(ik) * max(cwnb_m2(ispm1),zero) *efactm1
5901  esum(isp) = esum(isp) - ea_sig*va(ispm1,ip)
5902  END DO
5903  DO ik=1,nk-1
5904  isp = ith + (ik -1)*nth
5905  ispp1 = ith + (ik+1 -1)*nth
5906  efactp1 = dble( cg1(ik+1) / cg1(ik) )
5907  ec_sig = esi * dwni_m2(ik) * min(cwnb_m2(isp),zero) * efactp1
5908  esum(isp) = esum(isp) - ec_sig*va(ispp1,ip)
5909  END DO
5910  END DO
5911 #ifdef W3_DEBUGFREQSHIFT
5912  WRITE(740+iaproc,*) ' after FreqShift oper eSum=', sum(abs(esum))
5913 #endif
5914  END IF
5915  END IF
5916 #ifdef W3_DEBUGSRC
5917  WRITE(740+iaproc,*) 'Step 4: sum(eSum)=', sum(esum)
5918 #endif
5919 #ifdef W3_DEBUGSOLVERCOH
5920  pre_va(:, ip)=real(esum)
5921 #endif
5922  esum(1:nspec) = esum(1:nspec) / aspar_diag(1:nspec)
5923 #ifdef W3_DEBUGFREQSHIFT
5924  WRITE(740+iaproc,*) 'JSEA=', jsea, ' nbIter=', nbiter
5925  DO isp=1,nspec
5926  ik=mapwn(isp)
5927  vanew(isp) = dble(cg(ik,isea)/clats(isea)) * esum(isp)
5928  END DO
5929  DO isp=1,nspec
5930  vaanew(isp) = vanew(isp)
5931  vaaacloc(isp) = vaacloc(isp)
5932  END DO
5933  DO ith=1,nth
5934  vaanew(ith + nspec) = fachfa * vaanew(ith + nspec - nth)
5935  vaanew(ith - nth ) = 0.
5936  vaaacloc(ith + nspec) = fachfa * vaaacloc(ith + nspec - nth)
5937  vaaacloc(ith - nth ) = 0.
5938  END DO
5939  DO isp=1-nth,nspec
5940  vflwn(isp) = max(cwnb_m2(isp),0.) * vaanew(isp) + min(cwnb_m2(isp),0.) * vaanew(isp + nth)
5941  END DO
5942  DO isp=1,nspec
5943  ediff(isp) = vanew(isp) - vaold(isp) - dwni_m2(mapwn(isp)) * (vflwn(isp-nth) - vflwn(isp) )
5944  eval1=max(cwnb_m2(isp-nth),0.) * vaaacloc(isp-nth) + min(cwnb_m2(isp-nth),0.) * vaanew(isp)
5945  eval2=max(cwnb_m2(isp),0.) * vaanew(isp) + min(cwnb_m2(isp),0.) * vaaacloc(isp + nth)
5946  ediffb(isp) = vanew(isp) - vaold(isp) - dwni_m2(mapwn(isp)) * (eval1 - eval2)
5947  END DO
5948  IF (isea .eq. 190) THEN
5949  DO ik=1,nk
5950  DO ith=1,nth
5951  isp = ith + (ik-1)*nth
5952  WRITE(740+iaproc,*) 'ISP/ITH/IK=', isp, ith, ik
5953  WRITE(740+iaproc,*) 'eDiff(A/B)=', ediff(isp), ediffb(isp)
5954  END DO
5955  END DO
5956  END IF
5957  WRITE(740+iaproc,*) 'NK=', nk, ' NTH=', nth
5958  esumpart=0
5959  DO ik=1,nk
5960  DO ith=1,nth
5961  isp = ith + (ik-1)*nth
5962  esumpart = esumpart + abs(ediff(isp))
5963  END DO
5964  IF (isea .eq. 190) THEN
5965  WRITE(740+iaproc,*) 'IK=', ik, ' eSumDiff=', esumpart
5966  END IF
5967  END DO
5968  WRITE(740+iaproc,*) 'sum(eDiff/VAnew/VAold)=', sum(abs(ediff)), sum(abs(vanew)), sum(abs(vaold))
5969 #endif
5970 
5971  IF (b_jgs_block_gauss_seidel) THEN
5972  va(1:nspec,ip) = real(esum) * iobdp_loc(ip)
5973 #ifdef W3_REF1
5974  DO ik=1,nk
5975  DO ith=1,nth
5976  isp = ith + (ik-1)*nth
5977  IF (refpars(3) .LT. 0.5 .AND. iobpd_loc(ith,ip) .EQ. 0 .AND. iobpa_loc(ip) .EQ. 0) THEN
5978  va(isp,ip) = vaold(isp,ip) * iobdp_loc(ip) ! Restores reflected action spectra ...
5979  ENDIF
5980  ENDDO
5981  ENDDO
5982 #endif
5983  ELSE
5984  u_jac(1:nspec,ip) = esum
5985  END IF
5986  ELSE
5987  esum = va(1:nspec,ip)
5988  ENDIF ! .NOT. LCONVERGED
5989 
5990  IF (b_jgs_terminate_difference) THEN
5991  sum_new = sum(esum)
5992  if (sum_new .gt. 0.d0) then
5993  diffnew = abs(sum(acloc-esum))/sum_new
5994 #ifdef W3_DEBUGFREQSHIFT
5995  WRITE(740+iaproc,*) 'DiffNew=', diffnew, ' Sum_new=', sum_new
5996 #endif
5997  p_is_converged = diffnew
5998  else
5999  p_is_converged = zero
6000  endif
6001 #ifdef W3_DEBUGFREQSHIFT
6002  WRITE(740+iaproc,*) 'p_is_converged=', p_is_converged
6003 #endif
6004  IF (p_is_converged .lt. b_jgs_diff_thr .and. nbiter .gt. 1) then
6005  is_converged = is_converged + 1
6006  lconverged(ip) = .true.
6007  ELSE
6008  lconverged(ip) = .false.
6009  ENDIF
6010  END IF
6011 #ifdef W3_DEBUGSRC
6012  WRITE(740+iaproc,*) 'sum(VA)out=', sum(va(:,ip))
6013 #endif
6014  END DO ! IP
6015 
6016  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 2')
6017 
6018 #ifdef W3_DEBUGSOLVERCOH
6019  WRITE (efile,40) nbiter
6020 40 FORMAT ('PRE_VA_',i4.4,'.txt')
6021  CALL check_array_integral_nx_r8(offdiag, "OffDiag(np) just check", np)
6022  ! CALL WRITE_VAR_TO_TEXT_FILE(PRE_VA, eFile)
6023  CALL check_array_integral_nx_r8(pre_va, "PRE_VA(np) just check", np)
6024  CALL all_va_integral_print(imod, "VA(np) before exchanges", 0)
6025 #endif
6026  IF (b_jgs_block_gauss_seidel) THEN
6028  ELSE
6029  CALL pdlib_exchange2dreal(u_jac)
6030  va(:,1:npa) = u_jac
6031  END IF
6032  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 3')
6033  !
6034  ! Terminate via number of iteration
6035  !
6036  IF (b_jgs_terminate_maxiter) THEN
6037  IF (nbiter .gt. b_jgs_maxiter) THEN
6038 #ifdef W3_DEBUGSOLVER
6039  WRITE(740+iaproc,*) 'Exiting by TERMINATE_MAXITER'
6040 #endif
6041  EXIT
6042  END IF
6043  END IF
6044  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 4')
6045  !
6046  ! Terminate via differences
6047  !
6048  IF (b_jgs_terminate_difference .and. int(mod(nbiter,10)) == 0) THEN ! Every 10th step check conv.
6049  CALL mpi_allreduce(is_converged, itmp, 1, mpi_int, mpi_sum, mpi_comm_wcmp, ierr)
6050  is_converged = itmp
6051  prop_conv = (dble(nx) - dble(is_converged))/dble(nx) * 100.
6052 #ifdef W3_DEBUGSOLVER
6053  WRITE(740+iaproc,*) 'solver', nbiter, is_converged, prop_conv, b_jgs_pmin
6054  FLUSH(740+iaproc)
6055 #endif
6056  IF (myrank == 0) WRITE(*,*) 'No. of solver iterations', nbiter, is_converged, prop_conv, b_jgs_pmin
6057  IF (prop_conv .le. b_jgs_pmin + tiny(1.)) THEN
6058 #ifdef W3_DEBUGFREQSHIFT
6059  WRITE(740+iaproc,*) 'prop_conv=', prop_conv
6060  WRITE(740+iaproc,*) 'NX=', nx
6061  WRITE(740+iaproc,*) 'is_converged=', is_converged
6062  WRITE(740+iaproc,*) 'Exiting by TERMINATE_DIFFERENCE'
6063 #endif
6064  EXIT
6065  END IF
6066  END IF
6067  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 5')
6068  !
6069  ! Terminate via norm
6070  !
6071  IF (b_jgs_terminate_norm) THEN
6072  sum_l2 =0
6073  DO ip = 1, np
6074  ip_glob=iplg(ip)
6075  IF (iobp_loc(ip).eq.1) THEN
6076  jsea=jx_to_jsea(ip)
6077  esi=pdlib_si(ip)
6078  esum=b_jac(:,ip)
6079  acloc=va(:,ip)
6080  isea= mapfs(1,ip_glob)
6081  esum(:) = esum(:) - aspar_diag(:)*acloc
6082  DO i = pdlib_ia_p(ip)+1, pdlib_ia_p(ip+1)
6083  jp=pdlib_ja(i)
6084  esum(:) = esum(:) - aspar_jac(:,i)*va(:,jp)
6085  END DO
6086  IF (fsrefraction) THEN
6087  cad=cad_the(:,ip)
6088  DO isp=1,nspec
6089  ispprevdir=listispprevdir(isp)
6090  ispnextdir=listispnextdir(isp)
6091  ea_the = - dtg*esi*max(zero,cad(ispprevdir))
6092  ec_the = dtg*esi*min(zero,cad(ispnextdir))
6093  esum(isp) = esum(isp) - ea_the*va(ispprevdir,ip)
6094  esum(isp) = esum(isp) - ec_the*va(ispnextdir,ip)
6095  END DO
6096  END IF
6097  IF (fsfreqshift) THEN
6098  cas=cas_sig(:,ip)
6099  cp_sig = max(zero,cas)
6100  cm_sig = min(zero,cas)
6101  DO ik = 0, nk + 1
6102 #ifdef NOCGTABLE
6103  CALL wavnu_local(sig(ik),dw(isea),wn1(ik),cg1(ik))
6104 #else
6105  cg1(ik) = cg(ik,isea)
6106  wn1(ik) = wn(ik,isea)
6107 #endif
6108  ENDDO
6109  DO ith=1,nth
6110  IF (iobpd_loc(ith,ip) .NE. 0) THEN
6111  DO ik=2,nk
6112  isp =ith + (ik -1)*nth
6113  ispm1=ith + (ik-1-1)*nth
6114  efactm1=cg(ik-1,isea) / cg1(ik)
6115  ea_sig= - esi*cp_sig(ispm1)/dmm(ik-1) * efactm1
6116  esum(isp) = esum(isp) - ea_sig*va(ispm1,ip)
6117  END DO
6118  DO ik=1,nk-1
6119  isp =ith + (ik -1)*nth
6120  ispp1=ith + (ik+1-1)*nth
6121  efactp1=cg(ik+1,isea) / cg1(ik)
6122  ec_sig= esi*cm_sig(ispp1)/dmm(ik) * efactp1
6123  esum(isp) = esum(isp) - ec_sig*va(ispp1,ip)
6124  END DO
6125  END IF
6126  END DO
6127  END IF
6128  sum_l2 = sum_l2 + sum(esum*esum)
6129  END IF
6130  END DO
6131  CALL mpi_allreduce(sum_l2, sum_l2_gl, 1, rtype, mpi_sum, mpi_comm_wcmp, ierr)
6132 #ifdef W3_DEBUGSOLVER
6133  WRITE(740+iaproc,*) 'Sum_L2_gl=', sum_l2_gl
6134  FLUSH(740+iaproc)
6135 #endif
6136  IF (sum_l2_gl .le. b_jgs_norm_thr) THEN
6137 #ifdef W3_DEBUGFREQSHIFT
6138  WRITE(740+iaproc,*) 'Exiting by TERMINATE_NORM'
6139 #endif
6140  EXIT
6141  END IF
6142  END IF
6143  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION SOLVER LOOP 6')
6144 
6145  nbiter = nbiter + 1
6146 
6147  END DO ! Open Do Loop ... End of Time Interval
6148 
6149 #ifdef W3_DEBUGSOLVER
6150  WRITE(740+iaproc,*) 'nbIter=', nbiter, ' B_JGS_MAXITER=', b_jgs_maxiter
6151  FLUSH(740+iaproc)
6152 #endif
6153  ! Tihs is below also goes into the matrix ... like the wave boundary ...
6154  DO ip = 1, npa
6155 #ifdef W3_DEBUGSRC
6156  WRITE(740+iaproc,*) 'IOBPD loop, Before, sum(VA)=', sum(va(:,ip))
6157 #endif
6158  DO isp=1,nspec
6159  ith = 1 + mod(isp-1,nth)
6160  va(isp,ip)=max(zero, va(isp,ip))*iobdp_loc(ip)*dble(iobpd_loc(ith,ip))
6161 #ifdef W3_REF1
6162  IF (refpars(3).LT.0.5.AND.iobpd_loc(ith,ip).EQ.0.AND.iobpa_loc(ip).EQ.0) THEN
6163  va(isp,ip) = vaold(isp,ip) ! restores reflected boundary values
6164  ENDIF
6165 #endif
6166  END DO
6167 #ifdef W3_DEBUGSRC
6168  WRITE(740+iaproc,*) 'IOBPD loop, After, sum(VA)=', sum(va(:,ip))
6169 #endif
6170  END DO
6171 #ifdef W3_DEBUGSOLVERCOH
6172  CALL all_va_integral_print(imod, "VA(npa) after loop", 1)
6173 #endif
6174 #ifdef W3_DEBUGSOLVER
6175  WRITE(740+iaproc,*) 'FLBPI=', flbpi
6176  FLUSH(740+iaproc)
6177 #endif
6178 
6179  DO jsea=1, nseal
6180 
6181  ip = jsea
6182  ip_glob = iplg(ip)
6183  isea = mapfs(1,ip_glob)
6184  !
6185 #ifdef W3_DEBUGSRC
6186  intdiff=0
6187  sumvs=0
6188  sumvd=0
6189  sumvain=0
6190  sumvaout=0
6191  sumvaw3srce=0
6192  sumacout=0
6193 #endif
6194  !
6195  DO isp=1,nspec
6196 
6197  ik = 1 + (isp-1)/nth
6198 #ifdef NOCGTABLE
6199  CALL wavnu_local(sig(ik),dw(isea),wn1(ik),cg1(ik))
6200 #else
6201  cg1(ik) = cg(ik,isea)
6202 #endif
6203  eva = max( zero ,cg1(ik)/clats(isea)*real(va(isp,ip)) )
6204  evo = max( zero ,cg1(ik)/clats(isea)*real(vaold(isp,jsea)) )
6205 #ifdef W3_DEBUGSRC
6206  sumacout=sumacout + real(va(isp,ip))
6207  vs_w3srce = vstot(isp,jsea) * dtg / max(1., (1. - dtg*vdtot(isp,jsea)))
6208  eva_w3srce = max(0., va(isp,jsea) + vs_w3srce)
6209  intdiff = intdiff + abs(eva - eva_w3srce)
6210  acsolve=b_jac(isp,ip)/aspar_jac(isp,pdlib_i_diag(ip))
6211  eb=va(isp,jsea) + dtg*(vstot(isp,jsea) - vdtot(isp,jsea)*va(isp,jsea))
6212  evasolve=max(0., cg(ik,isea)/clats(isea)*acsolve)
6213  vasolve(isp)=evasolve
6214  sumvs = sumvs + abs(vstot(isp,jsea))
6215  sumvd = sumvd + abs(vdtot(isp,jsea))
6216  sumvain = sumvain + abs(va(isp,jsea))
6217  sumvaout = sumvaout + abs(eva)
6218  sumvaw3srce = sumvaw3srce + abs(eva_w3srce)
6219 #endif
6220  vaold(isp,jsea) = evo
6221  va(isp,jsea) = eva
6222  END DO
6223 #ifdef W3_DEBUGSRC
6224  WRITE(740+iaproc,*) 'ISEA=', isea, ' IntDiff=', intdiff, ' DTG=', dtg
6225  IF (isea .eq. testnode) THEN
6226  DO isp=1,nspec
6227  WRITE(740+iaproc,*) 'ISP=', isp, 'VA/VAsolve=', va(isp,jsea), vasolve(isp)
6228  END DO
6229  END IF
6230  WRITE(740+iaproc,*) 'SHAVE=', shavetot(jsea)
6231  WRITE(740+iaproc,*) 'Sum(VS/VD)=', sumvs, sumvd
6232  WRITE(740+iaproc,*) 'min/max/sum(VS)=', minval(vstot(:,jsea)), maxval(vstot(:,jsea)), sum(vstot(:,jsea))
6233  WRITE(740+iaproc,*) 'min/max/sum(VD)=', minval(vdtot(:,jsea)), maxval(vdtot(:,jsea)), sum(vdtot(:,jsea))
6234  WRITE(740+iaproc,*) 'min/max/sum(VA)=', minval(va(:,jsea)), maxval(va(:,jsea)), sum(va(:,jsea))
6235  WRITE(740+iaproc,*) 'min/max/sum(VAsolve)=', minval(vasolve), maxval(vasolve), sum(vasolve)
6236  WRITE(740+iaproc,*) 'SumVA(in/out/w3srce)=', sumvain, sumvaout, sumvaw3srce
6237  WRITE(740+iaproc,*) 'SumACout=', sumacout
6238 #endif
6239 
6240  IF (flsou) THEN
6241  IF (b_jgs_limiter) THEN
6242 
6243  DO isp=1,nspec
6244  ik = 1 + (isp-1)/nth
6245  spec(isp) = vaold(isp,jsea)
6246  ENDDO
6247 #ifdef W3_ST4
6248  CALL w3spr4 (spec, cg1, wn1, emean, fmean, fmean1, wnmean, &
6249  amax, u10(isea), u10d(isea), &
6250 #ifdef W3_FLX5
6251  taua, tauadir, dair, &
6252 #endif
6253  ustar, ustdir, &
6254  tauwx, tauwy, cd, z0, charn, llws, fmeanws, dlwmean)
6255 #endif
6256 
6257  dam = 0.
6258  DO ik=1, nk
6259  dam(1+(ik-1)*nth) = 0.0081*0.1 / ( 2 * sig(ik) * wn(ik,isea)**3 * cg(ik,isea)) * cg1(ik) / clats(isea)
6260  END DO
6261  !
6262  DO ik=1, nk
6263  is0 = (ik-1)*nth
6264  DO ith=2, nth
6265  dam(ith+is0) = dam(1+is0)
6266  END DO
6267  END DO
6268 
6269  dam2 = 0.
6270  DO ik=1, nk
6271  jac2 = 1./tpi/sig(ik)
6272  frlocal = sig(ik)*tpiinv
6273  dam2(1+(ik-1)*nth) = 1e-06 * grav/frlocal**4 * ustar * max(fmeanws,fmean) * dtg * jac2 * cg1(ik) / clats(isea)
6274  END DO
6275  DO ik=1, nk
6276  is0 = (ik-1)*nth
6277  DO ith=2, nth
6278  dam2(ith+is0) = dam2(1+is0)
6279  END DO
6280  END DO
6281 
6282  DO ik = 1, nk
6283  DO ith = 1, nth
6284  isp = ith + (ik-1)*nth
6285  newdac = va(isp,ip) - vaold(isp,jsea)
6286  maxdac = max(dam(isp),dam2(isp))
6287  newdac = sign(min(maxdac,abs(newdac)), newdac)
6288  va(isp,ip) = max(0., vaold(isp,ip) + newdac)
6289  ENDDO
6290  ENDDO
6291  ENDIF ! B_JGS_LIMITER
6292  ENDIF ! FLSOU
6293  END DO ! JSEA
6294 
6295 #ifdef WEIGHTS
6296  INQUIRE ( file='weights.ww3', exist = lexist )
6297  if (.not. lexist) then
6298  ipitergl = 0
6299  ipiterout = 0
6300  DO ip = 1, np
6301  ipitergl(iplg(ip)) = ipiter(ip)
6302  END DO
6303  call mpi_reduce(ipitergl,ipiterout,np_global,mpi_int,mpi_sum,0,mpi_comm_wcmp,ierr)
6304  if (myrank == 0) tHEN
6305  OPEN(100001,file='weights.ww3',form='FORMATTED',status='unknown')
6306  do ip = 1, np_global
6307  write(100001,*) ipiterout(ip)
6308  enddo
6309  CLOSE(100001)
6310  endif
6311  endif
6312 #endif
6313  !
6314  call print_memcheck(memunit, 'memcheck_____:'//' WW3_PROP SECTION LOOP 7')
6315  !
6316 #ifdef W3_DEBUGSRC
6317  DO jsea=1,nseal
6318  WRITE(740+iaproc,*) 'JSEA=', jsea
6319  WRITE(740+iaproc,*) 'min/max/sum(VA)=', minval(va(:,jsea)), maxval(va(:,jsea)), sum(va(:,jsea))
6320  END DO
6321  WRITE(740+iaproc,*) 'min/max/sum(VAtot)=', minval(va), maxval(va), sum(va)
6322 #endif
6323 
6324 
6325 #ifdef W3_DEBUGSOLVER
6326  WRITE(740+iaproc,*) 'PDLIB_JACOBI_GAUSS_SEIDEL_BLOCK, end'
6327  FLUSH(740+iaproc)
6328 #endif

References all_va_integral_print(), apply_boundary_condition(), aspar_diag_all, aspar_jac, b_jac, w3gdatmd::b_jgs_block_gauss_seidel, w3gdatmd::b_jgs_diff_thr, w3gdatmd::b_jgs_limiter, w3gdatmd::b_jgs_maxiter, w3gdatmd::b_jgs_nlevel, w3gdatmd::b_jgs_norm_thr, w3gdatmd::b_jgs_pmin, w3gdatmd::b_jgs_source_nonlinear, w3gdatmd::b_jgs_terminate_difference, w3gdatmd::b_jgs_terminate_maxiter, w3gdatmd::b_jgs_terminate_norm, cad_the, calcarray_jacobi4(), calcarray_jacobi_source_1(), calcarray_jacobi_source_2(), calcarray_jacobi_spectral_1(), calcarray_jacobi_spectral_2(), calcarray_jacobi_vec(), cas_sig, w3adatmd::cg, check_array_integral_nx_r8(), w3gdatmd::clats, cwnb_sig_m2, w3adatmd::cx, w3adatmd::cy, w3timemd::dsec21(), w3gdatmd::dsip, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfa, w3gdatmd::facp, file(), w3odatmd::flbpi, w3idatmd::flcur, w3idatmd::fllev, w3gdatmd::flsou, freqshiftmethod, w3gdatmd::fsfreqshift, fsgeoadvect, w3gdatmd::fsrefraction, w3gdatmd::fssource, constants::grav, w3odatmd::iaproc, w3parall::imem, w3parall::init_get_jsea_isproc(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, w3parall::jx_to_jsea, w3parall::listispnextdir, w3parall::listispprevdir, w3parall::lsloc, w3gdatmd::mapfs, w3gdatmd::mapsta, w3gdatmd::mapwn, memunit, w3adatmd::mpi_comm_wcmp, w3odatmd::nbi, w3gdatmd::nk, w3gdatmd::nk2, yownodepool::np, yownodepool::np_global, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3gdatmd::nx, w3gdatmd::optioncall, yowfunction::pdlib_abort(), yownodepool::pdlib_ccon, yowexchangemodule::pdlib_exchange2dreal(), yowexchangemodule::pdlib_exchange2dreal_zero(), yownodepool::pdlib_i_diag, yownodepool::pdlib_ia_p, yownodepool::pdlib_ja, yownodepool::pdlib_nnz, yownodepool::pdlib_si, w3gdatmd::refpars, yowdatapool::rtype, w3wdatmd::shavetot, w3gdatmd::sig, w3servmd::strace(), w3odatmd::tbpin, w3parall::thr8, w3wdatmd::time, constants::tpi, constants::tpiinv, w3adatmd::u10, w3adatmd::u10d, u_jac, w3wdatmd::ust, w3wdatmd::va, w3wdatmd::vaold, w3wdatmd::vdtot, w3wdatmd::vstot, w3src4md::w3spr4(), w3dispmd::wavnu_local(), w3adatmd::wn, and w3parall::zero.

Referenced by pdlib_w3xypug_block_implicit().

◆ pdlib_mapsta_init()

subroutine pdlib_w3profsmd::pdlib_mapsta_init ( integer, intent(in)  IMOD)

Definition at line 403 of file w3profsmd_pdlib.F90.

403  !/
404  !/ +-----------------------------------+
405  !/ | WAVEWATCH III NOAA/NCEP |
406  !/ | |
407  !/ | Aron Roland (BGS IT&E GmbH) |
408  !/ | Mathieu Dutour-Sikiric (IRB) |
409  !/ | |
410  !/ | FORTRAN 90 |
411  !/ | Last update : 01-June-2018 |
412  !/ +-----------------------------------+
413  !/
414  !/ 01-June-2018 : Origination. ( version 6.04 )
415  !/
416  ! 1. Purpose : Init mapsta part for pdlib
417  ! 2. Method :
418  ! 3. Parameters :
419  !
420  ! Parameter list
421  ! ----------------------------------------------------------------
422  ! ----------------------------------------------------------------
423  !
424  ! 4. Subroutines used :
425  !
426  ! Name Type Module Description
427  ! ----------------------------------------------------------------
428  ! STRACE Subr. W3SERVMD Subroutine tracing.
429  ! ----------------------------------------------------------------
430  !
431  ! 5. Called by :
432  !
433  ! Name Type Module Description
434  ! ----------------------------------------------------------------
435  ! ----------------------------------------------------------------
436  !
437  ! 6. Error messages :
438  ! 7. Remarks
439  ! 8. Structure :
440  ! 9. Switches :
441  !
442  ! !/S Enable subroutine tracing.
443  !
444  ! 10. Source code :
445  !
446  !/ ------------------------------------------------------------------- /
447 #ifdef W3_S
448  USE w3servmd, only: strace
449 #endif
450  !
451  USE w3gdatmd, only : index_map, nbnd_map, nsea, nseal, mapsta, grids, nx, nth
452  USE w3gdatmd, only : mapsta_loc, nbnd_map, index_map
453  USE w3odatmd, only : iaproc, naproc
454  USE yownodepool, only: iplg, npa
455  USE yowfunction, only: pdlib_abort
456  USE w3odatmd, only: iaproc
457  !/
458  !/
459  !/ ------------------------------------------------------------------- /
460  !/ Parameter list
461  !/
462  !/ ------------------------------------------------------------------- /
463  !/ Local PARAMETERs
464  !/
465 #ifdef W3_S
466  INTEGER, SAVE :: IENT = 0
467 #endif
468  !/
469  !/ ------------------------------------------------------------------- /
470  !/
471  INTEGER :: IBND_MAP, ISEA, JSEA, IX, IP, IP_glob
472  INTEGER, INTENT(in) :: IMOD
473  INTEGER :: Status(NX), istat
474  REAL :: rtmp(nseal)
475 #ifdef W3_S
476  CALL strace (ient, 'PDLIB_MAPSTA_INIT')
477 #endif
478 #ifdef W3_DEBUGINIT
479  WRITE(*,*) 'Passing by PDLIB_MAPSTA_INIT IAPROC=', iaproc
480 #endif
481  IF (iaproc .gt. naproc) THEN
482  RETURN
483  END IF
484 
485  ALLOCATE(grids(imod)%MAPSTA_LOC(npa), stat=istat)
486  if(istat /= 0) CALL pdlib_abort(5)
487  mapsta_loc => grids(imod)%MAPSTA_LOC
488  nbnd_map => grids(imod)%NBND_MAP
489  status = 0
490  DO ip=1,npa
491  ip_glob=iplg(ip)
492  status(ip_glob)=ip
493  mapsta_loc(ip)=mapsta(1,ip_glob)
494  END DO
495  nbnd_map = 0
496  DO ix=1,nx
497  IF ((mapsta(1,ix) .lt. 1).and.(status(ix).gt.0)) THEN
498  nbnd_map = nbnd_map + 1
499  END IF
500  END DO
501 
502  ALLOCATE(grids(imod)%INDEX_MAP(nbnd_map), stat=istat)
503  if(istat /= 0) CALL pdlib_abort(6)
504  index_map => grids(imod)%INDEX_MAP
505  ibnd_map = 0
506  DO ix = 1, nx
507  IF ((mapsta(1,ix) .lt. 1).and.(status(ix).gt.0)) THEN
508  ibnd_map = ibnd_map + 1
509  index_map(ibnd_map) = status(ix)
510  END IF
511  END DO
512  !/
513  !/ End of W3SPR4 ----------------------------------------------------- /
514  !/

References w3gdatmd::grids, w3odatmd::iaproc, w3gdatmd::index_map, yownodepool::iplg, w3gdatmd::mapsta, w3gdatmd::mapsta_loc, w3odatmd::naproc, w3gdatmd::nbnd_map, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3gdatmd::nth, w3gdatmd::nx, yowfunction::pdlib_abort(), and w3servmd::strace().

Referenced by w3initmd::w3init().

◆ pdlib_w3xypfsfct2()

subroutine pdlib_w3profsmd::pdlib_w3xypfsfct2 ( integer, intent(in)  ISP,
real, dimension(npa,2), intent(in)  C,
logical, intent(in)  LCALC,
real, intent(in)  RD10,
real, intent(in)  RD20,
real, intent(in)  DT,
real, dimension(npa), intent(inout)  AC 
)

Definition at line 1496 of file w3profsmd_pdlib.F90.

1496  !/
1497  !/ +-----------------------------------+
1498  !/ | WAVEWATCH III NOAA/NCEP |
1499  !/ | |
1500  !/ | Aron Roland (BGS IT&E GmbH) |
1501  !/ | Mathieu Dutour-Sikiric (IRB) |
1502  !/ | |
1503  !/ | FORTRAN 90 |
1504  !/ | Last update : 01-June-2018 |
1505  !/ +-----------------------------------+
1506  !/
1507  !/ 01-June-2018 : Origination. ( version 6.04 )
1508  !/
1509  ! 1. Purpose : Explicit PSI-Scheme
1510  ! 2. Method :
1511  ! 3. Parameters :
1512  !
1513  ! Parameter list
1514  ! ----------------------------------------------------------------
1515  ! ----------------------------------------------------------------
1516  !
1517  ! 4. Subroutines used :
1518  !
1519  ! Name Type Module Description
1520  ! ----------------------------------------------------------------
1521  ! STRACE Subr. W3SERVMD Subroutine tracing.
1522  ! ----------------------------------------------------------------
1523  !
1524  ! 5. Called by :
1525  !
1526  ! Name Type Module Description
1527  ! ----------------------------------------------------------------
1528  ! ----------------------------------------------------------------
1529  !
1530  ! 6. Error messages :
1531  ! 7. Remarks
1532  ! 8. Structure :
1533  ! 9. Switches :
1534  !
1535  ! !/S Enable subroutine tracing.
1536  !
1537  ! 10. Source code :
1538  !
1539  !/ ------------------------------------------------------------------- /
1540 
1541 
1542  USE w3gdatmd, only: nk, nth, nx, ien, clats, mapsf
1544  USE w3wdatmd, only: time
1545  USE w3adatmd, only: cg, iter, dw , cflxymax, nsealm
1546  USE w3odatmd, only: ndse, ndst, flbpi, nbi, tbpin, isbpi, bbpi0, bbpin
1547  USE w3timemd, only: dsec21
1548  USE w3adatmd, only: mpi_comm_wcmp
1549  USE w3gdatmd, only: nseal, dmin, nsea
1550 #ifdef W3_REF1
1551  USE w3gdatmd, only: refpars
1552 #endif
1554  use yowelementpool, only: ne, ine
1555  use yowdatapool, only: rtype
1557  USE w3odatmd, only : iaproc
1558  USE mpi, only : mpi_min
1559  USE w3parall, only : init_get_jsea_isproc
1560  USE w3parall, only : onesixth, zero, thr
1561  USE yowrankmodule, only : ipgl_npa
1562 
1563  IMPLICIT NONE
1564  INTEGER, INTENT(IN) :: ISP ! Actual Frequency/Wavenumber,
1565  ! actual Wave Direction
1566  REAL, INTENT(IN) :: DT ! Time intervall for which the
1567  ! advection should be computed
1568  ! for the given velocity field
1569  REAL, INTENT(IN) :: C(npa,2) ! Velocity field in it's
1570  ! X- and Y- Components,
1571  REAL, INTENT(INOUT) :: AC(npa) ! Wave Action before and
1572  ! after advection
1573  REAL, INTENT(IN) :: RD10, RD20 ! Time interpolation
1574  ! coefficients for boundary
1575  ! conditions
1576  LOGICAL, INTENT(IN) :: LCALC ! Switch for the calculation of
1577  ! the max. Global Time step
1578 #ifdef W3_S
1579  INTEGER, SAVE :: IENT = 0
1580 #endif
1581 #ifdef W3_REF1
1582  INTEGER(KIND=1) :: IOBPDR(NX)
1583 #endif
1584  INTEGER :: IP, IE, POS, IT, I1, I2, I3, I, J, ITH, IK
1585  INTEGER :: IBI, NI(3)
1586  INTEGER :: JX
1587  !
1588  ! local REAL
1589  !
1590  REAL :: RD1, RD2
1591  !:
1592  ! local double
1593  !
1594  REAL :: SUMTHETA, CFLXY
1595  real*8 :: ft, utilde
1596  real*8 :: fl11, fl12, fl21, fl22, fl31, fl32
1597  real*8 :: fl111, fl112, fl211, fl212, fl311, fl312
1598  REAL :: DTSI(npa), U(npa), UL(npa)
1599  REAL :: DTMAX_GL, DTMAX, DTMAXEXP, REST
1600  real*8 :: lambda(2), ktmp(3)
1601  real*8 :: kelem(3,ne), flall(3,ne)
1602  real*8 :: kksum(npa), st(npa)
1603  real*8 :: nm(ne), bet1(3), betahat(3), tmp(3), tmp1
1604  INTEGER :: ISPROC, JSEA, IP_glob, ierr, IX
1605  REAL :: eSumAC, sumAC, sumBPI0, sumBPIN, sumCG, sumCLATS
1606  LOGICAL :: testWrite
1607  REAL :: FIN(1), FOUT(1)
1608  REAL :: UIP(NE), UIPIP(NPA), UIMIP(NPA), U3(3)
1609  real*8 :: theta_h(3), theta_ace(3,ne), theta_l(3,ne)
1610  real*8 :: pm(npa), pp(npa), uim(ne), wii(2,npa)
1611  REAL :: USTARI(2,NPA)
1612 
1613 #ifdef W3_S
1614  CALL strace (ient, 'W3XYPFSN')
1615 #endif
1616 #ifdef W3_DEBUGSOLVER
1617  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 1'
1618  FLUSH(740+iaproc)
1619  CALL scal_integral_print_r4(ac, "AC in input")
1620 #endif
1621 
1622  ith = 1 + mod(isp-1,nth)
1623  ik = 1 + (isp-1)/nth
1624  dtmax = dble(10.e10)
1625  !
1626 #ifdef W3_REF1
1627  iobpdr(:)=(1-iobp_loc(:))*(1-iobpd_loc(ith,:))
1628 #endif
1629 
1630 #ifdef W3_DEBUGSOLVER
1631  WRITE(740+iaproc,*) 'NX=', nx
1632  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 2'
1633  FLUSH(740+iaproc)
1634 #endif
1635  !
1636  !2 Propagation
1637  !2.a Calculate K-Values and contour based quantities ...
1638  !
1639 
1640  DO ie = 1, ne
1641  i1 = ine(1,ie)
1642  i2 = ine(2,ie)
1643  i3 = ine(3,ie)
1644  lambda(1) = onesixth *(c(i1,1)+c(i2,1)+c(i3,1)) ! Linearized advection speed in X and Y direction
1645  lambda(2) = onesixth *(c(i1,2)+c(i2,2)+c(i3,2))
1646  kelem(1,ie) = lambda(1) * pdlib_ien(1,ie) + lambda(2) * pdlib_ien(2,ie) ! K-Values - so called Flux Jacobians
1647  kelem(2,ie) = lambda(1) * pdlib_ien(3,ie) + lambda(2) * pdlib_ien(4,ie)
1648  kelem(3,ie) = lambda(1) * pdlib_ien(5,ie) + lambda(2) * pdlib_ien(6,ie)
1649  ktmp = kelem(:,ie) ! Copy
1650  nm(ie) = - 1.d0/min(-thr,sum(min(zero,ktmp))) ! N-Values
1651  kelem(:,ie) = max(zero,ktmp)
1652  fl11 = c(i2,1) * pdlib_ien(1,ie) + c(i2,2) * pdlib_ien(2,ie) ! Weights for Simpson Integration
1653  fl12 = c(i3,1) * pdlib_ien(1,ie) + c(i3,2) * pdlib_ien(2,ie)
1654  fl21 = c(i3,1) * pdlib_ien(3,ie) + c(i3,2) * pdlib_ien(4,ie)
1655  fl22 = c(i1,1) * pdlib_ien(3,ie) + c(i1,2) * pdlib_ien(4,ie)
1656  fl31 = c(i1,1) * pdlib_ien(5,ie) + c(i1,2) * pdlib_ien(6,ie)
1657  fl32 = c(i2,1) * pdlib_ien(5,ie) + c(i2,2) * pdlib_ien(6,ie)
1658  fl111 = 2.d0*fl11+fl12
1659  fl112 = 2.d0*fl12+fl11
1660  fl211 = 2.d0*fl21+fl22
1661  fl212 = 2.d0*fl22+fl21
1662  fl311 = 2.d0*fl31+fl32
1663  fl312 = 2.d0*fl32+fl31
1664  flall(1,ie) = (fl311 + fl212)! * ONESIXTH + KELEM(1,IE)
1665  flall(2,ie) = (fl111 + fl312)! * ONESIXTH + KELEM(2,IE)
1666  flall(3,ie) = (fl211 + fl112)! * ONESIXTH + KELEM(3,IE)
1667  END DO
1668 
1669  IF (lcalc) THEN
1670  kksum = zero
1671  DO ie = 1, ne
1672  ni = ine(:,ie)
1673  kksum(ni) = kksum(ni) + kelem(:,ie)
1674  END DO
1675  dtmaxexp = 1.e10
1676  DO ip = 1, np
1677  ip_glob = iplg(ip)
1678  IF (iobp_loc(ip) .EQ. 1 .OR. fsbccfl) THEN
1679  dtmaxexp = pdlib_si(ip)/max(dble(10.e-10),kksum(ip)*iobdp_loc(ip))
1680  dtmax = min( dtmax, dtmaxexp)
1681  ENDIF
1682  cflxymax(ip) = max(cflxymax(ip),dble(dt)/dtmaxexp)
1683  END DO
1684  fin(1)=dtmax
1685  CALL mpi_allreduce(fin,fout,1,rtype,mpi_min,mpi_comm_wcmp,ierr)
1686  dtmax_gl=fout(1)
1687  cflxy = dble(dt)/dtmax_gl
1688  rest = abs(mod(cflxy,1.0d0))
1689  IF (rest .LT. thr) THEN
1690  iter(ik,ith) = abs(nint(cflxy))
1691  ELSE IF (rest .GT. thr .AND. rest .LT. 0.5d0) THEN
1692  iter(ik,ith) = abs(nint(cflxy)) + 1
1693  ELSE
1694  iter(ik,ith) = abs(nint(cflxy))
1695  END IF
1696  END IF ! LCALC
1697 
1698  DO ip = 1, npa
1699  dtsi(ip) = dble(dt)/dble(iter(ik,ith))/pdlib_si(ip) ! Some precalculations for the time integration.
1700  END DO
1701 
1702  DO it = 1, iter(ik,ith)
1703 
1704  u = dble(ac)
1705  st = zero
1706  pm = zero
1707  pp = zero
1708  DO ie = 1, ne
1709  ni = ine(:,ie)
1710  ft = - onesixth*dot_product(u(ni),flall(:,ie))
1711  utilde = nm(ie) * ( dot_product(kelem(:,ie),u(ni)) - ft )
1712  theta_l(:,ie) = kelem(:,ie) * (u(ni) - utilde)
1713  IF (abs(ft) .GT. 0.0d0) THEN
1714  bet1(:) = theta_l(:,ie)/ft
1715  IF (any( bet1 .LT. 0.0d0) ) THEN
1716  betahat(1) = bet1(1) + 0.5d0 * bet1(2)
1717  betahat(2) = bet1(2) + 0.5d0 * bet1(3)
1718  betahat(3) = bet1(3) + 0.5d0 * bet1(1)
1719  bet1(1) = max(zero,min(betahat(1),1.d0-betahat(2),1.d0))
1720  bet1(2) = max(zero,min(betahat(2),1.d0-betahat(3),1.d0))
1721  bet1(3) = max(zero,min(betahat(3),1.d0-betahat(1),1.d0))
1722  theta_l(:,ie) = ft * bet1
1723  END IF
1724  END IF
1725  st(ni) = st(ni) + theta_l(:,ie) ! the 2nd term are the theta values of each node ...
1726  theta_h = (1./3.+dt/(2.*pdlib_tria(ie)) * kelem(:,ie) ) * ft ! LAX
1727  ! THETA_H = (1./3.+2./3.*KELEM(:,IE)/SUM(MAX(ZERO,KELEM(:,IE))))*FT ! CENTRAL ... can be tested as well a bit more dispersive then LAX
1728  theta_ace(:,ie) = theta_h-theta_l(:,ie)
1729  pp(ni) = pp(ni) + max(zero, -theta_ace(:,ie)) * dtsi(ni)
1730  pm(ni) = pm(ni) + min(zero, -theta_ace(:,ie)) * dtsi(ni)
1731  END DO
1732 
1733 #ifdef W3_DEBUGSOLVER
1734  IF (testwrite) THEN
1735  CALL scal_integral_print_r4(st, "ST in loop")
1736  END IF
1737 #endif
1738 
1739  DO ip = 1, npa
1740  ul(ip) = max(zero,u(ip)-dtsi(ip)*st(ip)*(1-iobpa_loc(ip)))*dble(iobpd_loc(ith,ip))*iobdp_loc(ip)
1741  END DO
1742 
1743 #ifdef MPI_PARALL_GRID
1744  CALL pdlib_exchange1dreal(ul)
1745 #endif
1746 
1747  ustari(1,:) = max(ul,u)
1748  ustari(2,:) = min(ul,u)
1749 
1750  uip = 0.
1751  uim = 0.
1752  DO ie = 1, ne
1753  ni = ine(:,ie)
1754  uip(ni) = max(uip(ni), maxval( ustari(1,ni) ))
1755  uim(ni) = min(uim(ni), minval( ustari(2,ni) ))
1756  END DO
1757 
1758  wii(1,:) = min(1.0d0,(uip-ul)/max( thr,pp))
1759  wii(2,:) = min(1.0d0,(uim-ul)/min(-thr,pm))
1760 
1761  st = zero
1762  DO ie = 1, ne
1763  i1 = ine(1,ie)
1764  i2 = ine(2,ie)
1765  i3 = ine(3,ie)
1766  IF (theta_ace(1,ie) .LT. zero) THEN
1767  tmp(1) = wii(1,i1)
1768  ELSE
1769  tmp(1) = wii(2,i1)
1770  END IF
1771  IF (theta_ace(2,ie) .LT. zero) THEN
1772  tmp(2) = wii(1,i2)
1773  ELSE
1774  tmp(2) = wii(2,i2)
1775  END IF
1776  IF (theta_ace(3,ie) .LT. zero) THEN
1777  tmp(3) = wii(1,i3)
1778  ELSE
1779  tmp(3) = wii(2,i3)
1780  END IF
1781  tmp1 = minval(tmp)
1782  st(i1) = st(i1) + theta_ace(1,ie) * tmp1! * (ONE - BL) + BL * THETA_L(1,IE)
1783  st(i2) = st(i2) + theta_ace(2,ie) * tmp1! * (ONE - BL) + BL * THETA_L(2,IE)
1784  st(i3) = st(i3) + theta_ace(3,ie) * tmp1! * (ONE - BL) + BL * THETA_L(3,IE)
1785  END DO
1786 
1787  DO ip = 1, npa
1788  u(ip) = max(zero,ul(ip)-dtsi(ip)*st(ip)*(1-iobpa_loc(ip)))*dble(iobpd_loc(ith,ip))*iobdp_loc(ip)
1789 #ifdef W3_REF1
1790  IF (refpars(3).LT.0.5.AND.iobpd_loc(ith,ip).EQ.0.AND.iobpa_loc(ip).EQ.0) u(ip) = ac(ip) ! restores reflected boundary values
1791 #endif
1792  END DO
1793 
1794  ac = real(u)
1795 
1796 #ifdef W3_DEBUGSOLVER
1797  IF (testwrite) THEN
1798  CALL scal_integral_print_r4(ac, "AC in loop")
1799  END IF
1800 #endif
1801  !
1802  ! 5 Update boundaries ... would be better to omit any if clause in this loop ...
1803  ! a possibility would be to use NBI = 0 when FLBPI is FALSE and loop on IBI whatever the value of NBI
1804  !
1805  IF ( flbpi ) THEN
1806  rd1=rd10 - dt * real(iter(ik,ith)-it)/real(iter(ik,ith))
1807  rd2=rd20
1808  IF ( rd2 .GT. 0.001 ) THEN
1809  rd2 = min(1.,max(0.,rd1/rd2))
1810  rd1 = 1. - rd2
1811  ELSE
1812  rd1 = 0.
1813  rd2 = 1.
1814  END IF
1815 #ifdef W3_DEBUGSOLVER
1816  sumac=0
1817  sumbpi0=0
1818  sumbpin=0
1819  sumcg=0
1820  sumclats=0
1821 #endif
1822  DO ibi = 1, nbi
1823  ip_glob = mapsf(isbpi(ibi),1)
1824  jx=ipgl_npa(ip_glob)
1825  IF (jx .gt. 0) THEN
1826  ac(jx) = ( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) &
1827  / cg(ik,isbpi(ibi)) * clats(isbpi(ibi))
1828 #ifdef W3_DEBUGSOLVER
1829  sumac=sumac + ac(jx)
1830  sumbpi0=sumbpi0 + bbpi0(isp,ibi)
1831  sumbpin=sumbpin + bbpin(isp,ibi)
1832  sumcg=sumcg + cg(ik,isbpi(ibi))
1833  sumclats=sumclats + clats(isbpi(ibi))
1834 #endif
1835  END IF
1836  END DO
1837  END IF
1838 
1839 #ifdef W3_DEBUGSOLVER
1840  WRITE(740+iaproc,*) 'NBI=', nbi
1841  WRITE(740+iaproc,*) 'RD1=', rd1, ' RD2=', rd2
1842  WRITE(740+iaproc,*) 'ISP=', isp, 'sumAC=', sumac
1843  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPI0=', sumbpi0
1844  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPIN=', sumbpin
1845  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCG=', sumcg
1846  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCLATS=', sumclats
1847  FLUSH(740+iaproc)
1848 #endif
1849  CALL pdlib_exchange1dreal(ac)
1850 
1851 #ifdef W3_DEBUGSOLVER
1852  IF (testwrite) THEN
1853  CALL scal_integral_print_r4(ac, "AC after FLBPI")
1854  END IF
1855 #endif
1856  END DO ! IT
1857 
1858 #ifdef W3_DEBUGSOLVER
1859  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 6'
1860  FLUSH(740+iaproc)
1861 #endif
1862 

References w3odatmd::bbpi0, w3odatmd::bbpin, w3adatmd::cflxymax, w3adatmd::cg, w3gdatmd::clats, w3gdatmd::dmin, w3timemd::dsec21(), w3adatmd::dw, w3odatmd::flbpi, w3gdatmd::fsbccfl, w3odatmd::iaproc, w3gdatmd::ien, yowelementpool::ine, w3parall::init_get_jsea_isproc(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::ipgl, yowrankmodule::ipgl_npa, yownodepool::iplg, w3odatmd::isbpi, iter, w3adatmd::iter, w3gdatmd::mapsf, w3adatmd::mpi_comm_wcmp, w3odatmd::nbi, w3odatmd::ndse, w3odatmd::ndst, yowelementpool::ne, w3gdatmd::nk, nm, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3adatmd::nsealm, w3gdatmd::nth, w3gdatmd::nx, w3parall::onesixth, yownodepool::pdlib_ccon, yowexchangemodule::pdlib_exchange1dreal(), yownodepool::pdlib_ie_cell2, yownodepool::pdlib_ien, yownodepool::pdlib_si, yownodepool::pdlib_tria, w3gdatmd::refpars, yowdatapool::rtype, scal_integral_print_r4(), w3servmd::strace(), w3odatmd::tbpin, w3parall::thr, w3wdatmd::time, and w3parall::zero.

Referenced by pdlib_w3xypug().

◆ pdlib_w3xypfsn2()

subroutine pdlib_w3profsmd::pdlib_w3xypfsn2 ( integer, intent(in)  ISP,
real, dimension(npa,2), intent(in)  C,
logical, intent(in)  LCALC,
real, intent(in)  RD10,
real, intent(in)  RD20,
real, intent(in)  DT,
real, dimension(npa), intent(inout)  AC 
)

Definition at line 870 of file w3profsmd_pdlib.F90.

870  !/
871  !/ +-----------------------------------+
872  !/ | WAVEWATCH III NOAA/NCEP |
873  !/ | |
874  !/ | Aron Roland (BGS IT&E GmbH) |
875  !/ | Mathieu Dutour-Sikiric (IRB) |
876  !/ | |
877  !/ | FORTRAN 90 |
878  !/ | Last update : 01-June-2018 |
879  !/ +-----------------------------------+
880  !/
881  !/ 01-June-2018 : Origination. ( version 6.04 )
882  !/
883  ! 1. Purpose : Explicit N-Scheme
884  ! 2. Method :
885  ! 3. Parameters :
886  !
887  ! Parameter list
888  ! ----------------------------------------------------------------
889  ! ----------------------------------------------------------------
890  !
891  ! 4. Subroutines used :
892  !
893  ! Name Type Module Description
894  ! ----------------------------------------------------------------
895  ! STRACE Subr. W3SERVMD Subroutine tracing.
896  ! ----------------------------------------------------------------
897  !
898  ! 5. Called by :
899  !
900  ! Name Type Module Description
901  ! ----------------------------------------------------------------
902  ! ----------------------------------------------------------------
903  !
904  ! 6. Error messages :
905  ! 7. Remarks
906  ! 8. Structure :
907  ! 9. Switches :
908  !
909  ! !/S Enable subroutine tracing.
910  !
911  ! 10. Source code :
912  !
913  !/ ------------------------------------------------------------------- /
914 #ifdef W3_S
915  USE w3servmd, only: strace
916 #endif
917  !
918  USE w3gdatmd, only: nk, nth, nx, ien, clats, mapsf
920  USE w3wdatmd, only: time
921  USE w3adatmd, only: cg, iter, dw , cflxymax, nsealm
922  USE w3odatmd, only: ndse, ndst, flbpi, nbi, tbpin, isbpi, bbpi0, bbpin
923  USE w3timemd, only: dsec21
924  USE w3adatmd, only: mpi_comm_wcmp
925  USE w3gdatmd, only: nseal, dmin, nsea
926 #ifdef W3_REF1
927  USE w3gdatmd, only: refpars
928 #endif
930  use yowelementpool, only: ne, ine
931  use yowdatapool, only: rtype
933  USE w3odatmd, only : iaproc
934  USE mpi, only : mpi_min
935  USE w3parall, only : init_get_jsea_isproc
936  USE w3parall, only : onesixth, zero, thr
937  USE yowrankmodule, only : ipgl_npa
938 
939  INTEGER, INTENT(IN) :: ISP ! Actual Frequency/Wavenumber,
940  ! actual Wave Direction
941  REAL, INTENT(IN) :: DT ! Time intervall for which the
942  ! advection should be computed
943  ! for the given velocity field
944  REAL, INTENT(IN) :: C(npa,2) ! Velocity field in it's
945  ! X- and Y- Components,
946  REAL, INTENT(INOUT) :: AC(npa) ! Wave Action before and
947  ! after advection
948  REAL, INTENT(IN) :: RD10, RD20 ! Time interpolation
949  ! coefficients for boundary
950  ! conditions
951  LOGICAL, INTENT(IN) :: LCALC ! Switch for the calculation of
952  ! the max. Global Time step
953 #ifdef W3_S
954  INTEGER, SAVE :: IENT = 0
955 #endif
956 #ifdef W3_REF1
957  INTEGER(KIND=1) :: IOBPDR(NX)
958 #endif
959  INTEGER :: IP, IE, POS, IT, I1, I2, I3, I, J, ITH, IK
960  INTEGER :: IBI, NI(3)
961  INTEGER :: JX
962  !
963  ! local REAL
964  !
965  REAL :: RD1, RD2
966  !:
967  ! local double
968  !
969  REAL :: UTILDE
970  REAL :: SUMTHETA
971  REAL :: FT, CFLXY
972  REAL :: FL11, FL12, FL21, FL22, FL31, FL32
973  REAL :: FL111, FL112, FL211, FL212, FL311, FL312
974  REAL :: DTSI(npa), U(npa)
975  REAL :: DTMAX_GL, DTMAX, DTMAXEXP, REST
976  REAL :: LAMBDA(2), KTMP(3)
977  REAL :: KELEM(3,NE), FLALL(3,NE)
978  REAL :: KKSUM(npa), ST(npa)
979  REAL :: NM(NE)
980  INTEGER :: ISPROC, JSEA, IP_glob, ierr, IX
981  REAL :: eSumAC, sumAC, sumBPI0, sumBPIN, sumCG, sumCLATS
982  LOGICAL :: testWrite
983  REAL :: FIN(1), FOUT(1)
984 #ifdef W3_S
985  CALL strace (ient, 'W3XYPFSN')
986 #endif
987 #ifdef W3_DEBUGSOLVER
988  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 1'
989  FLUSH(740+iaproc)
990  CALL scal_integral_print_r4(ac, "AC in input")
991 #endif
992 
993  ith = 1 + mod(isp-1,nth)
994  ik = 1 + (isp-1)/nth
995  dtmax = dble(10.e10)
996 
997  !
998 #ifdef W3_REF1
999  iobpdr(:)=(1-iobp_loc(:))*(1-iobpd_loc(ith,:))
1000 #endif
1001 
1002 #ifdef W3_DEBUGSOLVER
1003  WRITE(740+iaproc,*) 'NX=', nx
1004  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 2'
1005  FLUSH(740+iaproc)
1006 #endif
1007  !
1008  !2 Propagation
1009  !2.a Calculate K-Values and contour based quantities ...
1010  !
1011  DO ie = 1, ne
1012  i1 = ine(1,ie)
1013  i2 = ine(2,ie)
1014  i3 = ine(3,ie)
1015  lambda(1) = onesixth *(c(i1,1)+c(i2,1)+c(i3,1)) ! Linearized advection speed in X and Y direction
1016  lambda(2) = onesixth *(c(i1,2)+c(i2,2)+c(i3,2))
1017  kelem(1,ie) = lambda(1) * pdlib_ien(1,ie) + lambda(2) * pdlib_ien(2,ie) ! K-Values - so called Flux Jacobians
1018  kelem(2,ie) = lambda(1) * pdlib_ien(3,ie) + lambda(2) * pdlib_ien(4,ie)
1019  kelem(3,ie) = lambda(1) * pdlib_ien(5,ie) + lambda(2) * pdlib_ien(6,ie)
1020  ktmp = kelem(:,ie) ! Copy
1021  nm(ie) = - 1.d0/min(-thr,sum(min(zero,ktmp))) ! N-Values
1022  kelem(:,ie) = max(zero,ktmp)
1023  fl11 = c(i2,1) * pdlib_ien(1,ie) + c(i2,2) * pdlib_ien(2,ie) ! Weights for Simpson Integration
1024  fl12 = c(i3,1) * pdlib_ien(1,ie) + c(i3,2) * pdlib_ien(2,ie)
1025  fl21 = c(i3,1) * pdlib_ien(3,ie) + c(i3,2) * pdlib_ien(4,ie)
1026  fl22 = c(i1,1) * pdlib_ien(3,ie) + c(i1,2) * pdlib_ien(4,ie)
1027  fl31 = c(i1,1) * pdlib_ien(5,ie) + c(i1,2) * pdlib_ien(6,ie)
1028  fl32 = c(i2,1) * pdlib_ien(5,ie) + c(i2,2) * pdlib_ien(6,ie)
1029  fl111 = 2.d0*fl11+fl12
1030  fl112 = 2.d0*fl12+fl11
1031  fl211 = 2.d0*fl21+fl22
1032  fl212 = 2.d0*fl22+fl21
1033  fl311 = 2.d0*fl31+fl32
1034  fl312 = 2.d0*fl32+fl31
1035  flall(1,ie) = (fl311 + fl212) * onesixth + kelem(1,ie)
1036  flall(2,ie) = (fl111 + fl312) * onesixth + kelem(2,ie)
1037  flall(3,ie) = (fl211 + fl112) * onesixth + kelem(3,ie)
1038  END DO
1039 #ifdef W3_DEBUGSOLVER
1040  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 3'
1041  FLUSH(740+iaproc)
1042 #endif
1043  IF (lcalc) THEN
1044  kksum = zero
1045  DO ie = 1, ne
1046  ni = ine(:,ie)
1047  kksum(ni) = kksum(ni) + kelem(:,ie)
1048  END DO
1049  dtmaxexp = 1.e10
1050  DO ip = 1, np
1051  ip_glob = iplg(ip)
1052  IF (iobp_loc(ip) .EQ. 1 .OR. fsbccfl) THEN
1053  dtmaxexp = pdlib_si(ip)/max(dble(10.e-10),kksum(ip)*iobdp_loc(ip))
1054  dtmax = min( dtmax, dtmaxexp)
1055  ENDIF
1056  cflxymax(ip) = max(cflxymax(ip),dble(dt)/dtmaxexp)
1057  END DO
1058  fin(1)=dtmax
1059  CALL mpi_allreduce(fin,fout,1,rtype,mpi_min,mpi_comm_wcmp,ierr)
1060  dtmax_gl=fout(1)
1061  cflxy = dble(dt)/dtmax_gl
1062  rest = abs(mod(cflxy,1.0d0))
1063  IF (rest .LT. thr) THEN
1064  iter(ik,ith) = abs(nint(cflxy))
1065  ELSE IF (rest .GT. thr .AND. rest .LT. 0.5d0) THEN
1066  iter(ik,ith) = abs(nint(cflxy)) + 1
1067  ELSE
1068  iter(ik,ith) = abs(nint(cflxy))
1069  END IF
1070  END IF ! LCALC
1071 
1072 #ifdef W3_DEBUGSOLVER
1073  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 4'
1074  FLUSH(740+iaproc)
1075 #endif
1076  DO ip = 1, npa
1077  dtsi(ip) = dble(dt)/dble(iter(ik,ith))/pdlib_si(ip) ! Some precalculations for the time integration.
1078  END DO
1079 #ifdef W3_DEBUGSOLVER
1080  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 4.1'
1081  FLUSH(740+iaproc)
1082  CALL scal_integral_print_r4(pdlib_si, "PDLIB_SI in input")
1083  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 4.2'
1084  FLUSH(740+iaproc)
1085  CALL scal_integral_print_r4(dtsi, "DTSI in input")
1086  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 5'
1087  WRITE(740+iaproc,*) 'IK=', ik, ' ITH=', ith
1088  WRITE(740+iaproc,*) 'ITER=', iter(ik,ith)
1089  FLUSH(740+iaproc)
1090 #endif
1091 
1092 
1093  DO it = 1, iter(ik,ith)
1094 #ifdef W3_DEBUGSOLVER
1095  WRITE(740+iaproc,*) 'IK=', ik, ' ITH=', ith
1096  WRITE(740+iaproc,*) 'IT=', it, ' ITER=', iter(ik,ith)
1097  FLUSH(740+iaproc)
1098  IF (testwrite) THEN
1099  WRITE(740+iaproc,*) 'IT=', it
1100  FLUSH(740+iaproc)
1101  END IF
1102 #endif
1103  u = dble(ac)
1104  st = zero
1105  DO ie = 1, ne
1106  ni = ine(:,ie)
1107  utilde = nm(ie) * (dot_product(flall(:,ie),u(ni)))
1108  st(ni) = st(ni) + kelem(:,ie) * (u(ni) - utilde) ! the 2nd term are the theta values of each node ...
1109  END DO ! IE
1110 #ifdef W3_DEBUGSOLVER
1111  IF (testwrite) THEN
1112  CALL scal_integral_print_r4(st, "ST in loop")
1113  END IF
1114 #endif
1115  !
1116  ! IOBPD=0 : waves coming from land
1117  ! IOBPD=1 : waves coming from the coast
1118  !
1119  DO ip = 1, npa
1120  u(ip) = max(zero,u(ip)-dtsi(ip)*st(ip)*(1-iobpa_loc(ip)))*dble(iobpd_loc(ith,ip))*iobdp_loc(ip)
1121 #ifdef W3_REF1
1122  IF (refpars(3).LT.0.5.AND.iobpd_loc(ith,ip).EQ.0.AND.iobpa_loc(ip).EQ.0) u(ip) = ac(ip) ! restores reflected boundary values
1123 #endif
1124  END DO
1125 #ifdef W3_DEBUGSOLVER
1126  IF (testwrite) THEN
1127  CALL scal_integral_print_r4(u, "U in loop")
1128  END IF
1129 #endif
1130  ac = real(u)
1131 
1132 #ifdef W3_DEBUGSOLVER
1133  IF (testwrite) THEN
1134  CALL scal_integral_print_r4(ac, "AC in loop")
1135  END IF
1136 #endif
1137  !
1138  ! 5 Update boundaries ... would be better to omit any if clause in this loop ...
1139  ! a possibility would be to use NBI = 0 when FLBPI is FALSE and loop on IBI whatever the value of NBI
1140  !
1141  IF ( flbpi ) THEN
1142  rd1=rd10 - dt * real(iter(ik,ith)-it)/real(iter(ik,ith))
1143  rd2=rd20
1144  IF ( rd2 .GT. 0.001 ) THEN
1145  rd2 = min(1.,max(0.,rd1/rd2))
1146  rd1 = 1. - rd2
1147  ELSE
1148  rd1 = 0.
1149  rd2 = 1.
1150  END IF
1151 #ifdef W3_DEBUGSOLVER
1152  sumac=0
1153  sumbpi0=0
1154  sumbpin=0
1155  sumcg=0
1156  sumclats=0
1157 #endif
1158  DO ibi = 1, nbi
1159  ip_glob = mapsf(isbpi(ibi),1)
1160  jx=ipgl_npa(ip_glob)
1161  IF (jx .gt. 0) THEN
1162  ac(jx) = ( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) &
1163  / cg(ik,isbpi(ibi)) * clats(isbpi(ibi))
1164 #ifdef W3_DEBUGSOLVER
1165  sumac=sumac + ac(jx)
1166  sumbpi0=sumbpi0 + bbpi0(isp,ibi)
1167  sumbpin=sumbpin + bbpin(isp,ibi)
1168  sumcg=sumcg + cg(ik,isbpi(ibi))
1169  sumclats=sumclats + clats(isbpi(ibi))
1170 #endif
1171  END IF
1172  END DO
1173  END IF
1174 
1175 #ifdef W3_DEBUGSOLVER
1176  WRITE(740+iaproc,*) 'NBI=', nbi
1177  WRITE(740+iaproc,*) 'RD1=', rd1, ' RD2=', rd2
1178  WRITE(740+iaproc,*) 'ISP=', isp, 'sumAC=', sumac
1179  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPI0=', sumbpi0
1180  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPIN=', sumbpin
1181  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCG=', sumcg
1182  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCLATS=', sumclats
1183  FLUSH(740+iaproc)
1184 #endif
1185  CALL pdlib_exchange1dreal(ac)
1186 
1187 #ifdef W3_DEBUGSOLVER
1188  IF (testwrite) THEN
1189  CALL scal_integral_print_r4(ac, "AC after FLBPI")
1190  END IF
1191 #endif
1192  END DO
1193 #ifdef W3_DEBUGSOLVER
1194  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 6'
1195  FLUSH(740+iaproc)
1196 #endif

References w3odatmd::bbpi0, w3odatmd::bbpin, w3adatmd::cflxymax, w3adatmd::cg, w3gdatmd::clats, w3gdatmd::dmin, w3timemd::dsec21(), w3adatmd::dw, w3odatmd::flbpi, w3gdatmd::fsbccfl, w3odatmd::iaproc, w3gdatmd::ien, yowelementpool::ine, w3parall::init_get_jsea_isproc(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::ipgl, yowrankmodule::ipgl_npa, yownodepool::iplg, w3odatmd::isbpi, iter, w3adatmd::iter, w3gdatmd::mapsf, w3adatmd::mpi_comm_wcmp, w3odatmd::nbi, w3odatmd::ndse, w3odatmd::ndst, yowelementpool::ne, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3adatmd::nsealm, w3gdatmd::nth, w3gdatmd::nx, w3parall::onesixth, yowexchangemodule::pdlib_exchange1dreal(), yownodepool::pdlib_ien, yownodepool::pdlib_si, yownodepool::pdlib_tria, w3gdatmd::refpars, yowdatapool::rtype, scal_integral_print_r4(), w3servmd::strace(), w3odatmd::tbpin, w3parall::thr, w3wdatmd::time, and w3parall::zero.

Referenced by pdlib_w3xypug().

◆ pdlib_w3xypfspsi2()

subroutine pdlib_w3profsmd::pdlib_w3xypfspsi2 ( integer, intent(in)  ISP,
real, dimension(npa,2), intent(in)  C,
logical, intent(in)  LCALC,
real, intent(in)  RD10,
real, intent(in)  RD20,
real, intent(in)  DT,
real, dimension(npa), intent(inout)  AC 
)

Definition at line 1200 of file w3profsmd_pdlib.F90.

1200  !/
1201  !/ +-----------------------------------+
1202  !/ | WAVEWATCH III NOAA/NCEP |
1203  !/ | |
1204  !/ | Aron Roland (BGS IT&E GmbH) |
1205  !/ | Mathieu Dutour-Sikiric (IRB) |
1206  !/ | |
1207  !/ | FORTRAN 90 |
1208  !/ | Last update : 01-June-2018 |
1209  !/ +-----------------------------------+
1210  !/
1211  !/ 01-June-2018 : Origination. ( version 6.04 )
1212  !/
1213  ! 1. Purpose : Explicit PSI-Scheme
1214  ! 2. Method :
1215  ! 3. Parameters :
1216  !
1217  ! Parameter list
1218  ! ----------------------------------------------------------------
1219  ! ----------------------------------------------------------------
1220  !
1221  ! 4. Subroutines used :
1222  !
1223  ! Name Type Module Description
1224  ! ----------------------------------------------------------------
1225  ! STRACE Subr. W3SERVMD Subroutine tracing.
1226  ! ----------------------------------------------------------------
1227  !
1228  ! 5. Called by :
1229  !
1230  ! Name Type Module Description
1231  ! ----------------------------------------------------------------
1232  ! ----------------------------------------------------------------
1233  !
1234  ! 6. Error messages :
1235  ! 7. Remarks
1236  ! 8. Structure :
1237  ! 9. Switches :
1238  !
1239  ! !/S Enable subroutine tracing.
1240  !
1241  ! 10. Source code :
1242  !
1243  !/ ------------------------------------------------------------------- /
1244 
1245 
1246  USE w3gdatmd, only: nk, nth, nx, ien, clats, mapsf
1248  USE w3wdatmd, only: time
1249  USE w3adatmd, only: cg, iter, dw , cflxymax, nsealm
1250  USE w3odatmd, only: ndse, ndst, flbpi, nbi, tbpin, isbpi, bbpi0, bbpin
1251  USE w3timemd, only: dsec21
1252  USE w3adatmd, only: mpi_comm_wcmp
1253  USE w3gdatmd, only: nseal, dmin, nsea
1254 #ifdef W3_REF1
1255  USE w3gdatmd, only: refpars
1256 #endif
1258  use yowelementpool, only: ne, ine
1259  use yowdatapool, only: rtype
1261  USE w3odatmd, only : iaproc
1262  USE mpi, only : mpi_min
1263  USE w3parall, only : init_get_jsea_isproc
1264  USE w3parall, only : onesixth, zero, thr
1265  USE yowrankmodule, only : ipgl_npa
1266  IMPLICIT NONE
1267  INTEGER, INTENT(IN) :: ISP ! Actual Frequency/Wavenumber,
1268  ! actual Wave Direction
1269  REAL, INTENT(IN) :: DT ! Time intervall for which the
1270  ! advection should be computed
1271  ! for the given velocity field
1272  REAL, INTENT(IN) :: C(npa,2) ! Velocity field in it's
1273  ! X- and Y- Components,
1274  REAL, INTENT(INOUT) :: AC(npa) ! Wave Action before and
1275  ! after advection
1276  REAL, INTENT(IN) :: RD10, RD20 ! Time interpolation
1277  ! coefficients for boundary
1278  ! conditions
1279  LOGICAL, INTENT(IN) :: LCALC ! Switch for the calculation of
1280  ! the max. Global Time step
1281 #ifdef W3_S
1282  INTEGER, SAVE :: IENT = 0
1283 #endif
1284 #ifdef W3_REF1
1285  INTEGER(KIND=1) :: IOBPDR(NX)
1286 #endif
1287  INTEGER :: IP, IE, POS, IT, I1, I2, I3, I, J, ITH, IK
1288  INTEGER :: IBI, NI(3), JX
1289  INTEGER :: ISPROC, IP_glob, JSEA, ierr
1290  REAL :: RD1, RD2
1291  REAL :: UTILDE
1292  REAL :: SUMTHETA
1293  REAL :: FL1, FL2, FL3
1294  REAL :: FT, CFLXY
1295  REAL :: FL11, FL12, FL21, FL22, FL31, FL32
1296  REAL :: FL111, FL112, FL211, FL212, FL311, FL312
1297  REAL :: DTSI(npa), U(npa)
1298  REAL :: DTMAX, DTMAX_GL, DTMAXEXP, REST
1299  REAL :: LAMBDA(2), KTMP(3), TMP(3)
1300  REAL :: THETA_L(3), BET1(3), BETAHAT(3)
1301  REAL :: KELEM(3,NE), FLALL(3,NE)
1302  REAL :: KKSUM(npa), ST(npa)
1303  REAL :: NM(NE), FIN(1), FOUT(1)
1304 #ifdef W3_S
1305  CALL strace (ient, 'W3XYPFSN')
1306 #endif
1307 #ifdef W3_DEBUGSOLVER
1308  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 1'
1309  FLUSH(740+iaproc)
1310  CALL scal_integral_print_r4(ac, "AC in input")
1311 #endif
1312 
1313  ith = 1 + mod(isp-1,nth)
1314  ik = 1 + (isp-1)/nth
1315  dtmax = dble(10.e10)
1316  !
1317 #ifdef W3_REF1
1318  iobpdr(:)=(1-iobp_loc(:))*(1-iobpd_loc(ith,:))
1319 #endif
1320 
1321 #ifdef W3_DEBUGSOLVER
1322  WRITE(740+iaproc,*) 'NX=', nx
1323  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 2'
1324  FLUSH(740+iaproc)
1325 #endif
1326  !
1327  !2 Propagation
1328  !2.a Calculate K-Values and contour based quantities ...
1329  !
1330 
1331  DO ie = 1, ne
1332  i1 = ine(1,ie)
1333  i2 = ine(2,ie)
1334  i3 = ine(3,ie)
1335  lambda(1) = onesixth *(c(i1,1)+c(i2,1)+c(i3,1)) ! Linearized advection speed in X and Y direction
1336  lambda(2) = onesixth *(c(i1,2)+c(i2,2)+c(i3,2))
1337  kelem(1,ie) = lambda(1) * pdlib_ien(1,ie) + lambda(2) * pdlib_ien(2,ie) ! K-Values - so called Flux Jacobians
1338  kelem(2,ie) = lambda(1) * pdlib_ien(3,ie) + lambda(2) * pdlib_ien(4,ie)
1339  kelem(3,ie) = lambda(1) * pdlib_ien(5,ie) + lambda(2) * pdlib_ien(6,ie)
1340  ktmp = kelem(:,ie) ! Copy
1341  nm(ie) = - 1.d0/min(-thr,sum(min(zero,ktmp))) ! N-Values
1342  kelem(:,ie) = max(zero,ktmp)
1343  fl11 = c(i2,1) * pdlib_ien(1,ie) + c(i2,2) * pdlib_ien(2,ie) ! Weights for Simpson Integration
1344  fl12 = c(i3,1) * pdlib_ien(1,ie) + c(i3,2) * pdlib_ien(2,ie)
1345  fl21 = c(i3,1) * pdlib_ien(3,ie) + c(i3,2) * pdlib_ien(4,ie)
1346  fl22 = c(i1,1) * pdlib_ien(3,ie) + c(i1,2) * pdlib_ien(4,ie)
1347  fl31 = c(i1,1) * pdlib_ien(5,ie) + c(i1,2) * pdlib_ien(6,ie)
1348  fl32 = c(i2,1) * pdlib_ien(5,ie) + c(i2,2) * pdlib_ien(6,ie)
1349  fl111 = 2.d0*fl11+fl12
1350  fl112 = 2.d0*fl12+fl11
1351  fl211 = 2.d0*fl21+fl22
1352  fl212 = 2.d0*fl22+fl21
1353  fl311 = 2.d0*fl31+fl32
1354  fl312 = 2.d0*fl32+fl31
1355  flall(1,ie) = (fl311 + fl212)! * ONESIXTH + KELEM(1,IE)
1356  flall(2,ie) = (fl111 + fl312)! * ONESIXTH + KELEM(2,IE)
1357  flall(3,ie) = (fl211 + fl112)! * ONESIXTH + KELEM(3,IE)
1358  END DO
1359 
1360  IF (lcalc) THEN
1361  kksum = zero
1362  DO ie = 1, ne
1363  ni = ine(:,ie)
1364  kksum(ni) = kksum(ni) + kelem(:,ie)
1365  END DO
1366  dtmaxexp = 1.e10
1367  DO ip = 1, npa
1368  ip_glob = iplg(ip)
1369  IF (iobp_loc(ip) .EQ. 1 .OR. fsbccfl) THEN
1370  dtmaxexp = pdlib_si(ip)/max(dble(10.e-10),kksum(ip)*iobdp_loc(ip))
1371  dtmax = min( dtmax, dtmaxexp)
1372  ENDIF
1373  cflxymax(ip) = max(cflxymax(ip),dble(dt)/dtmaxexp)
1374  END DO
1375  fin(1)=dtmax
1376  CALL mpi_allreduce(fin,fout,1,rtype,mpi_min,mpi_comm_wcmp,ierr)
1377  dtmax_gl=fout(1)
1378  cflxy = dble(dt)/dtmax_gl
1379  rest = abs(mod(cflxy,1.0d0))
1380  IF (rest .LT. thr) THEN
1381  iter(ik,ith) = abs(nint(cflxy))
1382  ELSE IF (rest .GT. thr .AND. rest .LT. 0.5d0) THEN
1383  iter(ik,ith) = abs(nint(cflxy)) + 1
1384  ELSE
1385  iter(ik,ith) = abs(nint(cflxy))
1386  END IF
1387  END IF ! LCALC
1388 
1389  DO ip = 1, npa
1390  dtsi(ip) = dble(dt)/dble(iter(ik,ith))/pdlib_si(ip) ! Some precalculations for the time integration.
1391  END DO
1392 
1393  DO it = 1, iter(ik,ith)
1394 
1395  u = dble(ac)
1396  st = zero
1397 
1398  DO ie = 1, ne
1399  ni = ine(:,ie)
1400  ft = - onesixth*dot_product(u(ni),flall(:,ie))
1401  utilde = nm(ie) * ( dot_product(kelem(:,ie),u(ni)) - ft )
1402  theta_l(:) = kelem(:,ie) * (u(ni) - utilde)
1403  IF (abs(ft) .GT. 0.0d0) THEN
1404  bet1(:) = theta_l(:)/ft
1405  IF (any( bet1 .LT. 0.0d0) ) THEN
1406  betahat(1) = bet1(1) + 0.5d0 * bet1(2)
1407  betahat(2) = bet1(2) + 0.5d0 * bet1(3)
1408  betahat(3) = bet1(3) + 0.5d0 * bet1(1)
1409  bet1(1) = max(zero,min(betahat(1),1.d0-betahat(2),1.d0))
1410  bet1(2) = max(zero,min(betahat(2),1.d0-betahat(3),1.d0))
1411  bet1(3) = max(zero,min(betahat(3),1.d0-betahat(1),1.d0))
1412  theta_l(:) = ft * bet1
1413  END IF
1414  ELSE
1415  theta_l(:) = zero
1416  END IF
1417  st(ni) = st(ni) + theta_l ! the 2nd term are the theta values of each node ...
1418  END DO
1419 
1420 #ifdef W3_DEBUGSOLVER
1421  IF (testwrite) THEN
1422  CALL scal_integral_print_r4(st, "ST in loop")
1423  END IF
1424 #endif
1425  !
1426  DO ip = 1, npa
1427  u(ip) = max(zero,u(ip)-dtsi(ip)*st(ip)*(1-iobpa_loc(ip)))*iobpd_loc(ith,ip)*iobdp_loc(ip)
1428 #ifdef W3_REF1
1429  IF (refpars(3).LT.0.5.AND.iobpd_loc(ith,ip).EQ.0.AND.iobpa_loc(ip).EQ.0) u(ip) = ac(ip) ! restores reflected boundary values
1430 #endif
1431  END DO
1432  ac = real(u)
1433  !
1434  ! 5 Update boundaries ... this should be implemented differently ... it is better to omit any if clause in this loop ...
1435  !
1436  IF ( flbpi ) THEN
1437  rd1=rd10 - dt * real(iter(ik,ith)-it)/real(iter(ik,ith))
1438  rd2=rd20
1439  IF ( rd2 .GT. 0.001 ) THEN
1440  rd2 = min(1.,max(0.,rd1/rd2))
1441  rd1 = 1. - rd2
1442  ELSE
1443  rd1 = 0.
1444  rd2 = 1.
1445  END IF
1446  !
1447  ! NB: this treatment of the open boundary (time interpolation) is different from
1448  ! the constant boundary in the structured grids ... which restores the boundary
1449  ! to the initial value: IF ( MAPSTA(IXY).EQ.2 ) VQ(IXY) = AQ(IXY)
1450  ! Why this difference ?
1451  !
1452  DO ibi=1, nbi
1453  ip_glob = mapsf(isbpi(ibi),1)
1454  jx=ipgl_npa(ip_glob)
1455  IF (jx .gt. 0) THEN
1456  ac(jx) = ( rd1*bbpi0(isp,ibi) + rd2*bbpin(isp,ibi) ) &
1457  / cg(ik,isbpi(ibi)) * clats(isbpi(ibi))
1458 #ifdef W3_DEBUGSOLVER
1459  sumac=sumac + ac(jx)
1460  sumbpi0=sumbpi0 + bbpi0(isp,ibi)
1461  sumbpin=sumbpin + bbpin(isp,ibi)
1462  sumcg=sumcg + cg(ik,isbpi(ibi))
1463  sumclats=sumclats + clats(isbpi(ibi))
1464 #endif
1465  END IF
1466  ENDDO
1467  END IF
1468 
1469 #ifdef W3_DEBUGSOLVER
1470  WRITE(740+iaproc,*) 'NBI=', nbi
1471  WRITE(740+iaproc,*) 'RD1=', rd1, ' RD2=', rd2
1472  WRITE(740+iaproc,*) 'ISP=', isp, 'sumAC=', sumac
1473  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPI0=', sumbpi0
1474  WRITE(740+iaproc,*) 'ISP=', isp, 'sumBPIN=', sumbpin
1475  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCG=', sumcg
1476  WRITE(740+iaproc,*) 'ISP=', isp, 'sumCLATS=', sumclats
1477  FLUSH(740+iaproc)
1478 #endif
1479  CALL pdlib_exchange1dreal(ac)
1480 
1481 #ifdef W3_DEBUGSOLVER
1482  IF (testwrite) THEN
1483  CALL scal_integral_print_r4(ac, "AC after FLBPI")
1484  END IF
1485 #endif
1486  END DO ! IT
1487 
1488 #ifdef W3_DEBUGSOLVER
1489  WRITE(740+iaproc,*) 'PDLIB_W3XYPFSN2, step 6'
1490  FLUSH(740+iaproc)
1491 #endif
1492 

References w3odatmd::bbpi0, w3odatmd::bbpin, w3adatmd::cflxymax, w3adatmd::cg, w3gdatmd::clats, w3gdatmd::dmin, w3timemd::dsec21(), w3adatmd::dw, w3odatmd::flbpi, w3gdatmd::fsbccfl, w3odatmd::iaproc, w3gdatmd::ien, yowelementpool::ine, w3parall::init_get_jsea_isproc(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::ipgl, yowrankmodule::ipgl_npa, yownodepool::iplg, w3odatmd::isbpi, iter, w3adatmd::iter, w3gdatmd::mapsf, w3adatmd::mpi_comm_wcmp, w3odatmd::nbi, w3odatmd::ndse, w3odatmd::ndst, yowelementpool::ne, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nseal, w3adatmd::nsealm, w3gdatmd::nth, w3gdatmd::nx, w3parall::onesixth, yowexchangemodule::pdlib_exchange1dreal(), yownodepool::pdlib_ien, yownodepool::pdlib_si, yownodepool::pdlib_tria, w3gdatmd::refpars, yowdatapool::rtype, scal_integral_print_r4(), w3servmd::strace(), w3odatmd::tbpin, w3parall::thr, w3wdatmd::time, and w3parall::zero.

Referenced by pdlib_w3xypug().

◆ pdlib_w3xypug()

subroutine pdlib_w3profsmd::pdlib_w3xypug ( integer, intent(in)  ISP,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  DTG,
real, intent(in)  VGX,
real, intent(in)  VGY,
logical, intent(in)  LCALC 
)

Definition at line 632 of file w3profsmd_pdlib.F90.

632  !/
633  !/ +-----------------------------------+
634  !/ | WAVEWATCH III NOAA/NCEP |
635  !/ | |
636  !/ | Aron Roland (BGS IT&E GmbH) |
637  !/ | Mathieu Dutour-Sikiric (IRB) |
638  !/ | |
639  !/ | FORTRAN 90 |
640  !/ | Last update : 10-Jan-2011 |
641  !/ +-----------------------------------+
642  !/
643  !/ 10-Jan-2008 : Origination. ( version 3.13 )
644  !/ 10-Jan-2011 : Addition of implicit scheme ( version 3.14.4 )
645  !/ 06-Feb-2014 : PDLIB parallelization
646  !/
647  ! 1. Purpose : Explicit advection schemes driver
648  !
649  ! Propagation in physical space for a given spectral component.
650  ! Gives the choice of scheme on unstructured grid
651  ! Use the geographical parall algorithms for further speed.
652  !
653  ! 2. Method :
654  !
655  ! 3. Parameters :
656  !
657  ! Parameter list
658  ! ----------------------------------------------------------------
659  ! ----------------------------------------------------------------
660  !
661  ! Local variables.
662  ! ----------------------------------------------------------------
663  ! ----------------------------------------------------------------
664  !
665  ! 4. Subroutines used :
666  !
667  ! 5. Called by :
668  !
669  ! W3WAVE Wave model routine.
670  !
671  ! 6. Error messages :
672  !
673  ! None.
674  !
675  ! 7. Remarks :
676  ! make the interface between the WAVEWATCH and the WWM code.
677  !
678  ! 8. Structure :
679  !
680  !
681  ! 9. Switches :
682  !
683  ! !/S Enable subroutine tracing.
684  !
685  !
686  ! 10. Source code :
687  !/ ------------------------------------------------------------------- /
688  !/
689  !
690  USE constants
691  !
692  USE w3timemd, only: dsec21
693  !
694  USE w3gdatmd, only: nx, ny, mapfs, clats, &
695  flcx, flcy, nk, nth, dth, xfr, &
696  ecos, esin, sig, pfmove, &
697  iobp, iobpd, &
698  fsn, fspsi, fsfct, fsnimp, &
700  USE yownodepool, only: pdlib_ien, pdlib_tria
702  USE yownodepool, only: iplg, npa
703  USE w3wdatmd, only: time, va
704  USE w3odatmd, only: tbpi0, tbpin, flbpi
705  USE w3adatmd, only: cg, cx, cy, itime, dw
706  USE w3idatmd, only: flcur, fllev
707  USE w3gdatmd, only: nseal
708  USE w3odatmd, only: iaproc
709  USE w3dispmd, only : wavnu_local
710  !/ ------------------------------------------------------------------- /
711  !/ Parameter list
712  !/
713  INTEGER, INTENT(IN) :: ISP
714  REAL, INTENT(IN) :: FACX, FACY, DTG, VGX, VGY
715  LOGICAL, INTENT(IN) :: LCALC
716  LOGICAL :: SCHEME
717  !/
718  !/ ------------------------------------------------------------------- /
719  !/ Local PARAMETERs
720  !/
721  INTEGER :: ITH, IK, ISEA
722  INTEGER :: I, J, IE, IBND_MAP
723  INTEGER :: IP_glob
724  REAL :: CCOS, CSIN, CCURX, CCURY, WN1, CG1
725  REAL :: C(npa,2)
726  REAL :: RD1, RD2
727  !/
728  !/ Automatic work arrays
729  !/
730  REAL :: VLCFLX(npa), VLCFLY(npa)
731  REAL :: AC(npa)
732  REAL :: AC_MAP(NBND_MAP)
733  INTEGER :: JSEA, IP
734  !/ ------------------------------------------------------------------- /
735  !
736  ! 1. Preparations --------------------------------------------------- *
737  ! 1.a Set constants
738  !
739 #ifdef W3_S
740  CALL strace (ient, 'W3XYPUG')
741 #endif
742 #ifdef W3_DEBUGSOLVER
743  WRITE(740+iaproc,*) 'Begin of PDLIB_W3XYPUG'
744  FLUSH(740+iaproc)
745 #endif
746  ith = 1 + mod(isp-1,nth)
747  ik = 1 + (isp-1)/nth
748  ccos = facx * ecos(ith)
749  csin = facy * esin(ith)
750  ccurx = facx
751  ccury = facy
752  !
753  ! 1.b Initialize arrays
754  !
755  vlcflx = 0.
756  vlcfly = 0.
757  ac = 0.
758  !
759  ! 2. Calculate velocities ---------------- *
760  !
761  DO jsea = 1, nseal
762  ip = jsea
763  ip_glob = iplg(ip)
764  isea = mapfs(1,ip_glob)
765 #ifdef NOCGTABLE
766  CALL wavnu_local(sig(ik),dw(isea),wn1,cg1)
767  ac(ip) = va(isp,jsea) / cg1 * clats(isea)
768  vlcflx(ip) = ccos * cg1 / clats(isea)
769  vlcfly(ip) = csin * cg1
770 #else
771  ac(ip) = va(isp,jsea) / cg(ik,isea) * clats(isea)
772  vlcflx(ip) = ccos * cg(ik,isea) / clats(isea)
773  vlcfly(ip) = csin * cg(ik,isea)
774 #endif
775 #ifdef W3_MGP
776  vlcflx(ip) = vlcflx(ip) - ccurx*vgx/clats(isea)
777  vlcfly(ip) = vlcfly(ip) - ccury*vgy
778 #endif
779  END DO
780 
781 #ifdef W3_DEBUGSOLVER
782  WRITE(740+iaproc,*) 'ISP=', isp, ' ITH=', ith, ' IK=', ik
783  WRITE(740+iaproc,*) '1: maxval(VLCFLX)=', maxval(vlcflx)
784  WRITE(740+iaproc,*) '1: maxval(VLCFLY)=', maxval(vlcfly)
785  WRITE(740+iaproc,*) 'FLCUR=', flcur
786  FLUSH(740+iaproc)
787 #endif
788  IF ( flcur ) THEN
789  DO jsea=1, nseal
790  ip = jsea
791  ip_glob = iplg(ip)
792  isea = mapfs(1,ip_glob)
793  !
794  ! Currents are not included on coastal boundaries (COUNTSEACON(IXY) .NE. PDLIB_CCON(IXY))
795  !
796  IF (iobp_loc(ip) .GT. 0) THEN
797  vlcflx(ip) = vlcflx(ip) + ccurx*cx(isea)/clats(isea)
798  vlcfly(ip) = vlcfly(ip) + ccury*cy(isea)
799  END IF
800  END DO
801  END IF
802 
803  c(:,1) = vlcflx(:) * iobdp_loc
804  c(:,2) = vlcfly(:) * iobdp_loc
805  !
806  ! 4. Prepares boundary update
807  !
808  IF ( flbpi ) THEN
809  rd1 = dsec21( tbpi0, time )
810  rd2 = dsec21( tbpi0, tbpin )
811  ELSE
812  rd1=1.
813  rd2=0.
814  END IF
815  !
816  ! Saving data for MAPSTA business
817  !
818  IF (mapsta_hack) THEN
819  DO ibnd_map=1,nbnd_map
820  ip=index_map(ibnd_map)
821  ac_map(ibnd_map) = ac(ip)
822  END DO
823  END IF
824  !
825  ! 4. propagate using the selected scheme
826  !
827 #ifdef W3_DEBUGSOLVER
828  WRITE(740+iaproc,*) 'maxval(C)=', maxval(c)
829  FLUSH(740+iaproc)
830 #endif
831  IF (fsn) THEN
832  CALL pdlib_w3xypfsn2(isp, c, lcalc, rd1, rd2, dtg, ac)
833  ELSE IF (fspsi) THEN
834  CALL pdlib_w3xypfspsi2(isp, c, lcalc, rd1, rd2, dtg, ac)
835  ELSE IF (fsfct) THEN
836  CALL pdlib_w3xypfsfct2(isp, c, lcalc, rd1, rd2, dtg, ac)
837  ELSE IF (fsnimp) THEN
838  stop 'For PDLIB and FSNIMP, no function has been programmed yet'
839  ENDIF
840  !
841  IF (mapsta_hack) THEN
842  DO ibnd_map=1,nbnd_map
843  ip=index_map(ibnd_map)
844  ac(ip) = ac_map(ibnd_map)
845  END DO
846  END IF
847 #ifdef W3_DEBUGSOLVER
848  WRITE(740+iaproc,*) 'After solutioning'
849  FLUSH(740+iaproc)
850 #endif
851 
852  ! 6. Store results in VQ in proper format --------------------------- *
853  !
854  DO jsea=1, nseal
855  ip = jsea
856  ip_glob = iplg(ip)
857  isea=mapfs(1,ip_glob)
858  va(isp,jsea) = max( 0. , cg(ik,isea)/clats(isea)*ac(ip) )
859  END DO
860 #ifdef W3_DEBUGSOLVER
861  WRITE(740+iaproc,*) 'Leaving PDLIB_W3XYPUG'
862  FLUSH(740+iaproc)
863 #endif
864  !/
865  !/ End of W3SPR4 ----------------------------------------------------- /
866  !/

References w3adatmd::cg, w3gdatmd::clats, w3adatmd::cx, w3adatmd::cy, w3timemd::dsec21(), w3gdatmd::dth, w3adatmd::dw, w3gdatmd::ecos, w3gdatmd::esin, w3odatmd::flbpi, w3idatmd::flcur, w3gdatmd::flcx, w3gdatmd::flcy, w3idatmd::fllev, w3gdatmd::fsfct, w3gdatmd::fsn, w3gdatmd::fsnimp, w3gdatmd::fspsi, w3gdatmd::gtype, w3odatmd::iaproc, ient, w3gdatmd::index_map, w3gdatmd::iobdp_loc, w3gdatmd::iobp, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd, w3gdatmd::iobpd_loc, yownodepool::iplg, w3adatmd::itime, w3gdatmd::mapfs, mapsta_hack, w3gdatmd::nbnd_map, w3gdatmd::nk, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nth, w3gdatmd::nx, w3gdatmd::ny, yownodepool::pdlib_ien, yownodepool::pdlib_tria, pdlib_w3xypfsfct2(), pdlib_w3xypfsn2(), pdlib_w3xypfspsi2(), w3gdatmd::pfmove, w3gdatmd::sig, w3servmd::strace(), w3odatmd::tbpi0, w3odatmd::tbpin, w3wdatmd::time, w3gdatmd::ungtype, w3wdatmd::va, w3dispmd::wavnu_local(), and w3gdatmd::xfr.

Referenced by w3wavemd::w3wave().

◆ pdlib_w3xypug_block_explicit()

subroutine pdlib_w3profsmd::pdlib_w3xypug_block_explicit ( integer, intent(in)  IMOD,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  DTG,
real, intent(in)  VGX,
real, intent(in)  VGY,
logical, intent(in)  LCALC 
)

Definition at line 2807 of file w3profsmd_pdlib.F90.

2807  !/
2808  !/ +-----------------------------------+
2809  !/ | WAVEWATCH III NOAA/NCEP |
2810  !/ | |
2811  !/ | Aron Roland (BGS IT&E GmbH) |
2812  !/ | Mathieu Dutour-Sikiric (IRB) |
2813  !/ | |
2814  !/ | FORTRAN 90 |
2815  !/ | Last update : 01-June-2018 |
2816  !/ +-----------------------------------+
2817  !/
2818  !/ 01-June-2018 : Origination. ( version 6.04 )
2819  !/
2820  ! 1. Purpose : Driver for block explicit routine
2821  ! 2. Method :
2822  ! 3. Parameters :
2823  !
2824  ! Parameter list
2825  ! ----------------------------------------------------------------
2826  ! ----------------------------------------------------------------
2827  !
2828  ! 4. Subroutines used :
2829  !
2830  ! Name Type Module Description
2831  ! ----------------------------------------------------------------
2832  ! STRACE Subr. W3SERVMD Subroutine tracing.
2833  ! ----------------------------------------------------------------
2834  !
2835  ! 5. Called by :
2836  !
2837  ! Name Type Module Description
2838  ! ----------------------------------------------------------------
2839  ! ----------------------------------------------------------------
2840  !
2841  ! 6. Error messages :
2842  ! 7. Remarks
2843  ! 8. Structure :
2844  ! 9. Switches :
2845  !
2846  ! !/S Enable subroutine tracing.
2847  !
2848  ! 10. Source code :
2849  !
2850  !/ ------------------------------------------------------------------- /
2851 #ifdef W3_S
2852  USE w3servmd, only: strace
2853 #endif
2854  !
2855  USE w3odatmd, only: iaproc
2856  USE w3gdatmd, only: b_jgs_use_jacobi
2857 
2858  LOGICAL, INTENT(IN) :: LCALC
2859  INTEGER, INTENT(IN) :: IMOD
2860  REAL, INTENT(IN) :: FACX, FACY, DTG, VGX, VGY
2861 
2862  CALL pdlib_explicit_block(imod, facx, facy, dtg, vgx, vgy, lcalc)
2863  !/
2864  !/ End of W3XYPFSN ----------------------------------------------------- /
2865  !/

References w3gdatmd::b_jgs_use_jacobi, w3odatmd::iaproc, pdlib_explicit_block(), and w3servmd::strace().

Referenced by w3wavemd::w3wave().

◆ pdlib_w3xypug_block_implicit()

subroutine pdlib_w3profsmd::pdlib_w3xypug_block_implicit ( integer, intent(in)  IMOD,
real, intent(in)  FACX,
real, intent(in)  FACY,
real, intent(in)  DTG,
real, intent(in)  VGX,
real, intent(in)  VGY,
logical, intent(in)  LCALC 
)

Definition at line 2736 of file w3profsmd_pdlib.F90.

2736  !/ ------------------------------------------------------------------- /
2737  !/
2738  !/ +-----------------------------------+
2739  !/ | WAVEWATCH III NOAA/NCEP |
2740  !/ | |
2741  !/ | Aron Roland (BGS IT&E GmbH) |
2742  !/ | Mathieu Dutour-Sikiric (IRB) |
2743  !/ | |
2744  !/ | FORTRAN 90 |
2745  !/ | Last update : 01-June-2018 |
2746  !/ +-----------------------------------+
2747  !/
2748  !/ 01-June-2018 : Origination. ( version 6.04 )
2749  !/
2750  ! 1. Purpose : Block Explicit N-Scheme
2751  ! 2. Method :
2752  ! 3. Parameters :
2753  !
2754  ! Parameter list
2755  ! ----------------------------------------------------------------
2756  ! ----------------------------------------------------------------
2757  !
2758  ! 4. Subroutines used :
2759  !
2760  ! Name Type Module Description
2761  ! ----------------------------------------------------------------
2762  ! STRACE Subr. W3SERVMD Subroutine tracing.
2763  ! ----------------------------------------------------------------
2764  !
2765  ! 5. Called by :
2766  !
2767  ! Name Type Module Description
2768  ! ----------------------------------------------------------------
2769  ! ----------------------------------------------------------------
2770  !
2771  ! 6. Error messages :
2772  ! 7. Remarks
2773  ! 8. Structure :
2774  ! 9. Switches :
2775  !
2776  ! !/S Enable subroutine tracing.
2777  !
2778  ! 10. Source code :
2779  !
2780  !/ ------------------------------------------------------------------- /
2781 #ifdef W3_S
2782  USE w3servmd, only: strace
2783 #endif
2784  !
2785  USE w3odatmd, only: iaproc
2786  USE w3gdatmd, only: b_jgs_use_jacobi
2787 
2788  LOGICAL, INTENT(IN) :: LCALC
2789  INTEGER, INTENT(IN) :: IMOD
2790  REAL, INTENT(IN) :: FACX, FACY, DTG, VGX, VGY
2791 #ifdef W3_DEBUGSOLVER
2792  WRITE(740+iaproc,*) 'B_JGS_USE_JACOBI=', b_jgs_use_jacobi
2793  FLUSH(740+iaproc)
2794 #endif
2795  IF (b_jgs_use_jacobi) THEN
2796  CALL pdlib_jacobi_gauss_seidel_block(imod, facx, facy, dtg, vgx, vgy, lcalc)
2797  RETURN
2798  END IF
2799  WRITE(*,*) 'Error: You need to use with JGS_USE_JACOBI'
2800  stop 'Correct your implicit solver options'
2801  !/
2802  !/ End of W3XYPFSN --------------------------------------------------- /
2803  !/

References w3gdatmd::b_jgs_use_jacobi, w3odatmd::iaproc, pdlib_jacobi_gauss_seidel_block(), and w3servmd::strace().

Referenced by w3wavemd::w3wave().

◆ print_wn_statistic()

subroutine pdlib_w3profsmd::print_wn_statistic ( character(*), intent(in)  string)

Definition at line 2869 of file w3profsmd_pdlib.F90.

2869  !/
2870  !/ +-----------------------------------+
2871  !/ | WAVEWATCH III NOAA/NCEP |
2872  !/ | |
2873  !/ | Aron Roland (BGS IT&E GmbH) |
2874  !/ | Mathieu Dutour-Sikiric (IRB) |
2875  !/ | |
2876  !/ | FORTRAN 90 |
2877  !/ | Last update : 01-June-2018 |
2878  !/ +-----------------------------------+
2879  !/
2880  !/ 01-June-2018 : Origination. ( version 6.04 )
2881  !/
2882  ! 1. Purpose : Source code for parallel debugging
2883  ! 2. Method :
2884  ! 3. Parameters :
2885  !
2886  ! Parameter list
2887  ! ----------------------------------------------------------------
2888  ! ----------------------------------------------------------------
2889  !
2890  ! 4. Subroutines used :
2891  !
2892  ! Name Type Module Description
2893  ! ----------------------------------------------------------------
2894  ! STRACE Subr. W3SERVMD Subroutine tracing.
2895  ! ----------------------------------------------------------------
2896  !
2897  ! 5. Called by :
2898  !
2899  ! Name Type Module Description
2900  ! ----------------------------------------------------------------
2901  ! ----------------------------------------------------------------
2902  !
2903  ! 6. Error messages :
2904  ! 7. Remarks
2905  ! 8. Structure :
2906  ! 9. Switches :
2907  !
2908  ! !/S Enable subroutine tracing.
2909  !
2910  ! 10. Source code :
2911  !
2912  !/ ------------------------------------------------------------------- /
2913 #ifdef W3_S
2914  USE w3servmd, only: strace
2915 #endif
2916  !
2917 
2918  USE w3odatmd, only : iaproc
2919  USE w3gdatmd, only: nk
2920  USE w3adatmd, only: wn
2921  USE w3gdatmd, only: nseal
2922  USE yownodepool, only: np
2923 
2924  CHARACTER(*), INTENT(in) :: string
2925  REAL TotalSumDMM, eDMM, sumDMM
2926  INTEGER IP, IK, ISEA
2927  WRITE(740+iaproc,*) 'PRINT_WN_STATISTIC'
2928  totalsumdmm=0
2929  DO isea=1,nseal
2930  sumdmm=0
2931  DO ik=0, nk
2932  edmm = wn(ik+1,isea) - wn(ik,isea)
2933  sumdmm=sumdmm + abs(edmm)
2934  END DO
2935  IF (isea .eq. 1) THEN
2936  WRITE(740+iaproc,*) 'ISEA=', isea
2937  WRITE(740+iaproc,*) 'sumDMM=', sumdmm
2938  END IF
2939  totalsumdmm = totalsumdmm + sumdmm
2940  END DO
2941  WRITE(740+iaproc,*) 'string=', string
2942  WRITE(740+iaproc,*) 'TotalSumDMM=', totalsumdmm
2943  FLUSH(740+iaproc)
2944  !/
2945  !/ End of W3XYPFSN --------------------------------------------------- /
2946  !/

References w3odatmd::iaproc, w3gdatmd::nk, yownodepool::np, w3gdatmd::nseal, w3servmd::strace(), and w3adatmd::wn.

Referenced by w3initmd::w3init().

◆ printtotaloffcontrib()

subroutine pdlib_w3profsmd::printtotaloffcontrib ( character(*), intent(in)  string)

Definition at line 3083 of file w3profsmd_pdlib.F90.

3083  !/
3084  !/ +-----------------------------------+
3085  !/ | WAVEWATCH III NOAA/NCEP |
3086  !/ | |
3087  !/ | Aron Roland (BGS IT&E GmbH) |
3088  !/ | Mathieu Dutour-Sikiric (IRB) |
3089  !/ | |
3090  !/ | FORTRAN 90 |
3091  !/ | Last update : 01-June-2018 |
3092  !/ +-----------------------------------+
3093  !/
3094  !/ 01-June-2018 : Origination. ( version 6.04 )
3095  !/
3096  ! 1. Purpose : Source code for parallel debugging
3097  ! 2. Method :
3098  ! 3. Parameters :
3099  !
3100  ! Parameter list
3101  ! ----------------------------------------------------------------
3102  ! ----------------------------------------------------------------
3103  !
3104  ! 4. Subroutines used :
3105  !
3106  ! Name Type Module Description
3107  ! ----------------------------------------------------------------
3108  ! STRACE Subr. W3SERVMD Subroutine tracing.
3109  ! ----------------------------------------------------------------
3110  !
3111  ! 5. Called by :
3112  !
3113  ! Name Type Module Description
3114  ! ----------------------------------------------------------------
3115  ! ----------------------------------------------------------------
3116  !
3117  ! 6. Error messages :
3118  ! 7. Remarks
3119  ! 8. Structure :
3120  ! 9. Switches :
3121  !
3122  ! !/S Enable subroutine tracing.
3123  !
3124  ! 10. Source code :
3125  !
3126  !/ ------------------------------------------------------------------- /
3127 #ifdef W3_S
3128  USE w3servmd, only: strace
3129 #endif
3130  !
3132  USE w3gdatmd, only: nspec
3133  USE w3odatmd, only : iaproc
3134 
3135  CHARACTER(*), INTENT(in) :: string
3136  INTEGER J, IP, JP, I, ISP
3137  REAL TheSum1, TheSum2
3138  j = 0
3139  thesum1=0
3140  DO ip = 1, npa
3141  DO i = 1, pdlib_ccon(ip)
3142  j = j + 1
3143  IF (j .ne. pdlib_i_diag(ip)) THEN
3144  DO isp=1,nspec
3145  thesum1=thesum1 + abs(aspar_jac(isp,j))
3146  END DO
3147  END IF
3148  END DO
3149  END DO
3150  !
3151  thesum2=0
3152  DO ip = 1, npa
3153  DO i = pdlib_ia_p(ip)+1, pdlib_ia_p(ip+1)
3154  jp=pdlib_ja(i)
3155  IF (jp .ne. ip) THEN
3156  DO isp=1,nspec
3157  thesum2=thesum2 + abs(aspar_jac(isp,i))
3158  END DO
3159  END IF
3160  END DO
3161  END DO
3162  WRITE(740+iaproc,'(a,f14.7,f14.7,a,a)') 'TheSum12=', thesum1, thesum2, ' ', string
3163  FLUSH(740+iaproc)
3164  !/
3165  !/ End of W3XYPFSN --------------------------------------------------- /
3166  !/

References aspar_jac, w3odatmd::iaproc, yownodepool::npa, w3gdatmd::nspec, yownodepool::pdlib_ccon, yownodepool::pdlib_i_diag, yownodepool::pdlib_ia_p, yownodepool::pdlib_ja, and w3servmd::strace().

Referenced by calcarray_jacobi(), and calcarray_jacobi_vec().

◆ scal_integral_print_general()

subroutine pdlib_w3profsmd::scal_integral_print_general ( real*8, dimension(nseal), intent(in)  V,
character(*), intent(in)  string,
integer, intent(in)  maxidx,
logical, intent(in)  CheckUncovered,
logical, intent(in)  PrintFullValue 
)

Definition at line 1945 of file w3profsmd_pdlib.F90.

1945  !/
1946  !/ +-----------------------------------+
1947  !/ | WAVEWATCH III NOAA/NCEP |
1948  !/ | |
1949  !/ | Aron Roland (BGS IT&E GmbH) |
1950  !/ | Mathieu Dutour-Sikiric (IRB) |
1951  !/ | |
1952  !/ | FORTRAN 90 |
1953  !/ | Last update : 01-June-2018 |
1954  !/ +-----------------------------------+
1955  !/
1956  !/ 01-June-2018 : Origination. ( version 6.04 )
1957  !/
1958  ! 1. Purpose : Source code for parallel debugging
1959  ! 2. Method : maxidx = npa or np for arrays that have been synchronized or not
1960  ! CheckUncovered is because some the triangulation may not cover all nodes
1961  ! 3. Parameters :
1962  !
1963  ! Parameter list
1964  ! ----------------------------------------------------------------
1965  ! ----------------------------------------------------------------
1966  !
1967  ! 4. Subroutines used :
1968  !
1969  ! Name Type Module Description
1970  ! ----------------------------------------------------------------
1971  ! STRACE Subr. W3SERVMD Subroutine tracing.
1972  ! ----------------------------------------------------------------
1973  !
1974  ! 5. Called by :
1975  !
1976  ! Name Type Module Description
1977  ! ----------------------------------------------------------------
1978  ! ----------------------------------------------------------------
1979  !
1980  ! 6. Error messages :
1981  ! 7. Remarks
1982  ! 8. Structure :
1983  ! 9. Switches :
1984  !
1985  ! !/S Enable subroutine tracing.
1986  !
1987  ! 10. Source code :
1988  !
1989  !/ ------------------------------------------------------------------- /
1990  !
1991  USE w3gdatmd, only : nk, nth, fte
1992  USE w3gdatmd, only : nspec, nx, ny, nseal, mapfs
1993  USE w3adatmd, only : mpi_comm_wcmp
1994  USE w3gdatmd, only : gtype, ungtype
1995  USE w3odatmd, only : iaproc, naproc, ntproc
1996  use yowdatapool, only: rtype, istatus
1997  USE yownodepool, only: npa, iplg
1998  USE w3parall, only: init_get_isea
1999 
2000  include "mpif.h"
2001  !
2002  real*8, INTENT(in) :: v(nseal)
2003  CHARACTER(*), INTENT(in) :: string
2004  INTEGER, INTENT(IN) :: maxidx
2005  LOGICAL, INTENT(in) :: CheckUncovered
2006  LOGICAL, INTENT(in) :: PrintFullValue
2007  !
2008  real*8, allocatable :: vcoll(:)
2009  INTEGER, allocatable :: Status(:)
2010  real*8, allocatable :: listval(:)
2011  INTEGER, allocatable :: ListIdx(:)
2012  INTEGER singV(2)
2013  REAL CoherencyError, eVal1, eVal2, eErr
2014  INTEGER NSEAL_dist, maxidx_dist
2015  INTEGER JSEA, ISEA, iProc, I, IX, ierr, ISP, IP, IP_glob
2016  INTEGER nbIncorr, idx
2017  INTEGER ITH, IK
2018 
2019  IF (iaproc .gt. naproc) THEN
2020  RETURN
2021  END IF
2022  IF (gtype .ne. ungtype) THEN
2023  RETURN
2024  END IF
2025  !
2026  ! Now find global arrays
2027  !
2028  IF (iaproc .eq. 1) THEN
2029  coherencyerror=0
2030  allocate(vcoll(nx), status(nx))
2031  vcoll=0
2032  status=0
2033  DO jsea=1,maxidx
2034  ip = jsea
2035  ip_glob = iplg(ip)
2036  isea=mapfs(1,ip_glob)
2037  vcoll(ip_glob)=v(jsea)
2038  status(ip_glob)=1
2039  END DO
2040  DO iproc=2,naproc
2041  CALL mpi_recv(singv,2,mpi_integer, iproc-1, 360, mpi_comm_wcmp, istatus, ierr)
2042  nseal_dist = singv(1)
2043  maxidx_dist = singv(2)
2044  allocate(listval(nseal_dist), listidx(nseal_dist))
2045  CALL mpi_recv(listval, nseal_dist, mpi_real8, iproc-1, 370, mpi_comm_wcmp, istatus, ierr)
2046  CALL mpi_recv(listidx, nseal_dist, mpi_integer, iproc-1, 430, mpi_comm_wcmp, istatus, ierr)
2047  DO idx=1,maxidx_dist
2048  ip_glob = listidx(idx)
2049  eval1 = vcoll(ip_glob)
2050  eval2 = listval(idx)
2051  vcoll(ip_glob) = eval2
2052  IF (status(ip_glob) .eq. 1) THEN
2053  eerr=abs(eval1 - eval2)
2054  coherencyerror = coherencyerror + eerr
2055  END IF
2056  status(ip_glob) = 1
2057  END DO
2058  deallocate(listval, listidx)
2059  END DO
2060  WRITE(740+iaproc,'(a,f14.7,f14.7,a,a)') 'sum,coh=', sum(vcoll), coherencyerror, ' ', trim(string)
2061  nbincorr=0
2062  DO ix=1,nx
2063  isea=mapfs(1,ix)
2064  IF (isea .gt. 0) THEN
2065  IF (status(ix) .eq. 0) THEN
2066  nbincorr=nbincorr+1
2067  END IF
2068  END IF
2069  END DO
2070  IF (checkuncovered) THEN
2071  IF (nbincorr .gt. 0) THEN
2072  WRITE(*,*) ' nbIncorr=', nbincorr
2073  WRITE(*,*) ' NX=', nx
2074  WRITE(*,*) ' NSEAL=', nseal
2075  WRITE(*,*) ' npa=', npa
2076  stop
2077  END IF
2078  END IF
2079  IF (printfullvalue) THEN
2080  WRITE(740+iaproc,*) 'Value of V at nodes'
2081  DO ix=1,nx
2082  WRITE(740+iaproc,*) 'IX=', ix, ' V=', vcoll(ix)
2083  END DO
2084  END IF
2085  FLUSH(740+iaproc)
2086  deallocate(vcoll, status)
2087  ELSE
2088  singv(1) = nseal
2089  singv(2) = maxidx
2090  CALL mpi_send(singv,2,mpi_integer, 0, 360, mpi_comm_wcmp, ierr)
2091  allocate(listval(nseal), listidx(nseal))
2092  DO jsea=1,nseal
2093  ip = jsea
2094  ip_glob = iplg(ip)
2095  isea=mapfs(1,ip_glob)
2096  listval(jsea) = v(jsea)
2097  listidx(jsea) = ip_glob
2098  END DO
2099  CALL mpi_send(listval, nseal, mpi_real8, 0, 370, mpi_comm_wcmp, ierr)
2100  CALL mpi_send(listidx, nseal, mpi_integer, 0, 430, mpi_comm_wcmp, ierr)
2101  deallocate(listval, listidx)
2102  END IF

References w3gdatmd::fte, w3gdatmd::gtype, w3odatmd::iaproc, include(), w3parall::init_get_isea(), yownodepool::iplg, yowdatapool::istatus, w3gdatmd::mapfs, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, w3gdatmd::nk, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3odatmd::ntproc, w3gdatmd::nx, w3gdatmd::ny, yowdatapool::rtype, and w3gdatmd::ungtype.

Referenced by check_array_integral_nx_r8(), scal_integral_print_r4(), and scal_integral_print_r8().

◆ scal_integral_print_r4()

subroutine pdlib_w3profsmd::scal_integral_print_r4 ( real, dimension(nseal), intent(in)  V,
character(*), intent(in)  string 
)

Definition at line 2163 of file w3profsmd_pdlib.F90.

2163  !/
2164  !/ +-----------------------------------+
2165  !/ | WAVEWATCH III NOAA/NCEP |
2166  !/ | |
2167  !/ | Aron Roland (BGS IT&E GmbH) |
2168  !/ | Mathieu Dutour-Sikiric (IRB) |
2169  !/ | |
2170  !/ | FORTRAN 90 |
2171  !/ | Last update : 01-June-2018 |
2172  !/ +-----------------------------------+
2173  !/
2174  !/ 01-June-2018 : Origination. ( version 6.04 )
2175  !/
2176  ! 1. Purpose : Source code for parallel debugging
2177  ! 2. Method :
2178  ! 3. Parameters :
2179  !
2180  ! Parameter list
2181  ! ----------------------------------------------------------------
2182  ! ----------------------------------------------------------------
2183  !
2184  ! 4. Subroutines used :
2185  !
2186  ! Name Type Module Description
2187  ! ----------------------------------------------------------------
2188  ! STRACE Subr. W3SERVMD Subroutine tracing.
2189  ! ----------------------------------------------------------------
2190  !
2191  ! 5. Called by :
2192  !
2193  ! Name Type Module Description
2194  ! ----------------------------------------------------------------
2195  ! ----------------------------------------------------------------
2196  !
2197  ! 6. Error messages :
2198  ! 7. Remarks
2199  ! 8. Structure :
2200  ! 9. Switches :
2201  !
2202  ! !/S Enable subroutine tracing.
2203  !
2204  ! 10. Source code :
2205  !
2206  !/ ------------------------------------------------------------------- /
2207 
2208  USE w3gdatmd, only : nseal
2209 
2210  REAL, INTENT(in) :: V(NSEAL)
2211  CHARACTER(*), INTENT(in) :: string
2212  LOGICAL :: CheckUncovered = .false.
2213  LOGICAL :: PrintFullValue = .false.
2214  real*8 v8(nseal)
2215  v8 = dble(v)
2216  CALL scal_integral_print_general(v8, string, nseal, checkuncovered, printfullvalue)

References w3gdatmd::nseal, and scal_integral_print_general().

Referenced by pdlib_w3xypfsfct2(), pdlib_w3xypfsn2(), and pdlib_w3xypfspsi2().

◆ scal_integral_print_r8()

subroutine pdlib_w3profsmd::scal_integral_print_r8 ( real*8, dimension(nseal), intent(in)  V,
character(*), intent(in)  string 
)

Definition at line 2106 of file w3profsmd_pdlib.F90.

2106  !/
2107  !/ +-----------------------------------+
2108  !/ | WAVEWATCH III NOAA/NCEP |
2109  !/ | |
2110  !/ | Aron Roland (BGS IT&E GmbH) |
2111  !/ | Mathieu Dutour-Sikiric (IRB) |
2112  !/ | |
2113  !/ | FORTRAN 90 |
2114  !/ | Last update : 01-June-2018 |
2115  !/ +-----------------------------------+
2116  !/
2117  !/ 01-June-2018 : Origination. ( version 6.04 )
2118  !/
2119  ! 1. Purpose : Source code for parallel debugging
2120  ! 2. Method :
2121  ! 3. Parameters :
2122  !
2123  ! Parameter list
2124  ! ----------------------------------------------------------------
2125  ! ----------------------------------------------------------------
2126  !
2127  ! 4. Subroutines used :
2128  !
2129  ! Name Type Module Description
2130  ! ----------------------------------------------------------------
2131  ! STRACE Subr. W3SERVMD Subroutine tracing.
2132  ! ----------------------------------------------------------------
2133  !
2134  ! 5. Called by :
2135  !
2136  ! Name Type Module Description
2137  ! ----------------------------------------------------------------
2138  ! ----------------------------------------------------------------
2139  !
2140  ! 6. Error messages :
2141  ! 7. Remarks
2142  ! 8. Structure :
2143  ! 9. Switches :
2144  !
2145  ! !/S Enable subroutine tracing.
2146  !
2147  ! 10. Source code :
2148  !
2149  !/ ------------------------------------------------------------------- /
2150 
2151  USE w3gdatmd, only : nseal
2152 
2153  real*8, INTENT(in) :: v(nseal)
2154  CHARACTER(*), INTENT(in) :: string
2155  real*8 :: v8(nseal)
2156  LOGICAL :: CheckUncovered = .false.
2157  LOGICAL :: PrintFullValue = .false.
2158  v8 = v
2159  CALL scal_integral_print_general(v8, string, nseal, checkuncovered, printfullvalue)

References w3gdatmd::nseal, and scal_integral_print_general().

◆ set_iobdp_pdlib()

subroutine pdlib_w3profsmd::set_iobdp_pdlib

Definition at line 6814 of file w3profsmd_pdlib.F90.

6814  !/
6815  !/ +-----------------------------------+
6816  !/ | WAVEWATCH III NOAA/NCEP |
6817  !/ | |
6818  !/ | Aron Roland (BGS IT&E GmbH) |
6819  !/ | Mathieu Dutour-Sikiric (IRB) |
6820  !/ | |
6821  !/ | FORTRAN 90 |
6822  !/ | Last update : 01-June-2018 |
6823  !/ +-----------------------------------+
6824  !/
6825  !/ 01-June-2018 : Origination. ( version 6.04 )
6826  !/
6827  ! 1. Purpose : Set depth pointer
6828  ! 2. Method :
6829  ! 3. Parameters :
6830  !
6831  ! Parameter list
6832  ! ----------------------------------------------------------------
6833  ! ----------------------------------------------------------------
6834  !
6835  ! 4. Subroutines used :
6836  !
6837  ! Name Type Module Description
6838  ! ----------------------------------------------------------------
6839  ! STRACE Subr. W3SERVMD Subroutine tracing.
6840  ! ----------------------------------------------------------------
6841  !
6842  ! 5. Called by :
6843  !
6844  ! Name Type Module Description
6845  ! ----------------------------------------------------------------
6846  ! ----------------------------------------------------------------
6847  !
6848  ! 6. Error messages :
6849  ! 7. Remarks
6850  ! 8. Structure :
6851  ! 9. Switches :
6852  !
6853  ! !/S Enable subroutine tracing.
6854  !
6855  ! 10. Source code :
6856  !
6857  !/ ------------------------------------------------------------------- /
6858 #ifdef W3_S
6859  USE w3servmd, only: strace
6860 #endif
6861  USE constants, only : lpdlib
6862  USE w3gdatmd, only: mapsf, nseal, dmin, mapsta, nx
6864  USE w3adatmd, only: dw
6865  USE w3parall, only: init_get_isea
6866  USE yownodepool, only: iplg, np, npa
6867  !/
6868  !/
6869  !/ ------------------------------------------------------------------- /
6870  !/ Parameter list
6871  !/
6872  !/ ------------------------------------------------------------------- /
6873  !/ Local PARAMETERs
6874  !/
6875 #ifdef W3_S
6876  INTEGER, SAVE :: IENT = 0
6877 #endif
6878  !/
6879  !/ ------------------------------------------------------------------- /
6880  !/
6881  !
6882  INTEGER :: JSEA, ISEA, IX, IP, IP_glob
6883  real*8, PARAMETER :: dthr = 10e-6
6884 #ifdef W3_S
6885  CALL strace (ient, 'SETDEPTH_PDLIB')
6886 #endif
6887  DO jsea=1,npa
6888  ip = jsea
6889  ip_glob = iplg(ip)
6890  IF (dw(ip_glob) .LT. dmin + dthr) THEN
6891  iobdp_loc(ip) = 0
6892  ELSE
6893  iobdp_loc(ip) = 1
6894  ENDIF
6895  END DO
6896  !/
6897  !/ End of SETDEPTH_PDLIB --------------------------------------------- /
6898  !/

References w3gdatmd::dmin, w3adatmd::dw, w3parall::init_get_isea(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, constants::lpdlib, w3gdatmd::mapsf, w3gdatmd::mapsta, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nx, and w3servmd::strace().

Referenced by w3initmd::w3init(), and w3updtmd::w3ulev().

◆ set_iobpa_pdlib()

subroutine pdlib_w3profsmd::set_iobpa_pdlib

Definition at line 6903 of file w3profsmd_pdlib.F90.

6903  !/
6904  !/ +-----------------------------------+
6905  !/ | WAVEWATCH III NOAA/NCEP |
6906  !/ | |
6907  !/ | Aron Roland (BGS IT&E GmbH) |
6908  !/ | Mathieu Dutour-Sikiric (IRB) |
6909  !/ | |
6910  !/ | FORTRAN 90 |
6911  !/ | Last update : 01-June-2018 |
6912  !/ +-----------------------------------+
6913  !/
6914  !/ 01-June-2018 : Origination. ( version 6.04 )
6915  !/
6916  ! 1. Purpose : Set depth pointer
6917  ! 2. Method :
6918  ! 3. Parameters :
6919  !
6920  ! Parameter list
6921  ! ----------------------------------------------------------------
6922  ! ----------------------------------------------------------------
6923  !
6924  ! 4. Subroutines used :
6925  !
6926  ! Name Type Module Description
6927  ! ----------------------------------------------------------------
6928  ! STRACE Subr. W3SERVMD Subroutine tracing.
6929  ! ----------------------------------------------------------------
6930  !
6931  ! 5. Called by :
6932  !
6933  ! Name Type Module Description
6934  ! ----------------------------------------------------------------
6935  ! ----------------------------------------------------------------
6936  !
6937  ! 6. Error messages :
6938  ! 7. Remarks
6939  ! 8. Structure :
6940  ! 9. Switches :
6941  !
6942  ! !/S Enable subroutine tracing.
6943  !
6944  ! 10. Source code :
6945  !
6946  !/ ------------------------------------------------------------------- /
6947 #ifdef W3_S
6948  USE w3servmd, only: strace
6949 #endif
6950  USE constants, only : lpdlib
6951  USE w3gdatmd, only: mapsf, nseal, dmin, mapsta, nx
6953  USE w3adatmd, only: dw
6954  USE w3parall, only: init_get_isea
6955  USE yownodepool, only: iplg, np
6956  !/
6957  !/
6958  !/ ------------------------------------------------------------------- /
6959  !/ Parameter list
6960  !/
6961  !/ ------------------------------------------------------------------- /
6962  !/ Local PARAMETERs
6963  !/
6964 #ifdef W3_S
6965  INTEGER, SAVE :: IENT = 0
6966 #endif
6967  !/
6968  !/ ------------------------------------------------------------------- /
6969  !/
6970  !
6971  INTEGER :: JSEA, ISEA, IX, IP, IP_glob
6972  real*8, PARAMETER :: dthr = 10e-6
6973 #ifdef W3_S
6974  CALL strace (ient, 'SETDEPTH_PDLIB')
6975 #endif
6976  DO jsea=1,nseal
6977  ip_glob = iplg(jsea)
6978  IF (mapsta(1,ip_glob).EQ.2) THEN
6979  iobpa_loc(jsea) = 1
6980  ELSE
6981  iobpa_loc(jsea) = 0
6982  ENDIF
6983  END DO
6984  !/
6985  !/ End of SETDEPTH_PDLIB --------------------------------------------- /
6986  !/

References w3gdatmd::dmin, w3adatmd::dw, w3parall::init_get_isea(), w3gdatmd::iobdp_loc, w3gdatmd::iobp_loc, w3gdatmd::iobpa_loc, w3gdatmd::iobpd_loc, yownodepool::iplg, constants::lpdlib, w3gdatmd::mapsf, w3gdatmd::mapsta, yownodepool::np, w3gdatmd::nseal, w3gdatmd::nx, and w3servmd::strace().

Referenced by pdlib_iobp_init(), and w3initmd::w3init().

◆ set_ug_iobp_pdlib_init()

subroutine pdlib_w3profsmd::set_ug_iobp_pdlib_init

Definition at line 6991 of file w3profsmd_pdlib.F90.

6991  !/
6992  !/ +-----------------------------------+
6993  !/ | WAVEWATCH III NOAA/NCEP |
6994  !/ | Fabrice Ardhuin |
6995  !/ | Aron Roland |
6996  !/ | FORTRAN 90 |
6997  !/ | Last update : 17-Apr-2016 |
6998  !/ +-----------------------------------+
6999  !/
7000  !/ 23-Aug-2011 : Origination. ( version 4.04 )
7001  !/ 17-Apr-2016 : Uses optimized boundary detection ( version 5.10 )
7002  !/
7003  ! 1. Purpose :
7004  !
7005  ! Redefines the values of the boundary points and angle pointers
7006  ! based on the MAPSTA array
7007  !
7008  ! 2. Method :
7009  !
7010  ! Adapted boundary detection from A. Roland and M. Dutour (WWM code)
7011  !
7012  ! 3. Parameters :
7013  !
7014  ! Parameter list
7015  ! ----------------------------------------------------------------
7016  ! ----------------------------------------------------------------
7017  !
7018  ! Local variables.
7019  ! ----------------------------------------------------------------
7020  ! ----------------------------------------------------------------
7021  !
7022  ! 4. Subroutines used :
7023  !
7024 
7025  ! 5. Called by :
7026  !
7027  ! Name Type Module Description
7028  ! ----------------------------------------------------------------
7029  ! WW3_GRID Prog. WW3_GRID Grid preprocessor
7030  ! W3ULEV Subr. W3UPDTMD Water level update
7031  ! ----------------------------------------------------------------
7032  !
7033  ! 6. Error messages :
7034  !
7035  ! None.
7036  !
7037  ! 7. Remarks :
7038  !
7039  ! 8. Structure :
7040  !
7041  !
7042  ! 9. Switches :
7043  !
7044  ! !/S Enable subroutine tracing.
7045  !
7046  !
7047  ! 10. Source code :
7048  !/ ------------------------------------------------------------------- /
7049  !/
7050  !
7051  USE constants
7052  !
7053  !
7054  USE w3gdatmd, only: nx, ny, nsea, mapfs, &
7055  nk, nth, dth, xfr, mapsta, countri, &
7056  ecos, esin, ien, ntri, trigp, &
7057  iobp,iobpd, iobpa, &
7058 #ifdef w3_ref1
7059  refpars, reflc, refld, &
7060 #endif
7061  angle0, angle, nseal
7062 
7063  USE w3odatmd, only: tbpi0, tbpin, flbpi
7064  USE w3adatmd, only: cg, cx, cy, atrnx, atrny, itime, cflxymax
7066  USE w3idatmd, only: flcur
7067  USE w3odatmd, only : iaproc
7069  use yowelementpool, only: ne, ine
7071 #ifdef W3_S
7072  USE w3servmd, only: strace
7073 #endif
7074  !/ ------------------------------------------------------------------- /
7075  !/ Parameter list
7076  !/
7077  !/
7078  !/ ------------------------------------------------------------------- /
7079  !/ Local parameters
7080  !/
7081  INTEGER :: ITH, IX, I, J, IP, IE, NDIRSUM
7082  REAL (KIND = 8) :: cossum, sinsum
7083  REAL (KIND = 8) :: dirmin, dirmax, shift, tempo, dircoast
7084  REAL (KIND = 8) :: x1, x2, y1, y2, dxp1, dxp2, dxp3
7085  REAL (KIND = 8) :: dyp1, dyp2, dyp3, edet1, edet2, evx, evy
7086  REAL(KIND=8), parameter :: thr = tiny(1.)
7087  INTEGER :: I1, I2, I3
7088  INTEGER :: ITMP(NX), NEXTVERT(NX), PREVVERT(NX)
7089  INTEGER :: MAX_IOBPD, MIN_IOBPD
7090  REAL :: rtmp(NPA)
7091  CHARACTER(60) :: FNAME
7092 #ifdef W3_S
7093  INTEGER, SAVE :: IENT = 0
7094 #endif
7095  !/ ------------------------------------------------------------------- /
7096  !
7097  !
7098  DO ie = 1, ne
7099  i1 = ine(1,ie)
7100  i2 = ine(2,ie)
7101  i3 = ine(3,ie)
7102  dxp1 = pdlib_ien(6,ie)
7103  dyp1 = - pdlib_ien(5,ie)
7104  dxp2 = pdlib_ien(2,ie)
7105  dyp2 = - pdlib_ien(1,ie)
7106  dxp3 = pdlib_ien(4,ie)
7107  dyp3 = - pdlib_ien(3,ie)
7108  DO ith = 1, nth
7109  evx = ecos(ith)
7110  evy = esin(ith)
7111  DO i = 1, 3
7112  IF (i .eq. 1) THEN
7113  x1 = dxp1
7114  y1 = dyp1
7115  x2 = - dxp3
7116  y2 = - dyp3
7117  ip = i1
7118  ELSE IF (i.eq.2) THEN
7119  x1 = dxp2
7120  y1 = dyp2
7121  x2 = - dxp1
7122  y2 = - dyp1
7123  ip = i2
7124  ELSE IF (i.eq.3) THEN
7125  x1 = dxp3
7126  y1 = dyp3
7127  x2 = - dxp2
7128  y2 = - dyp2
7129  ip = i3
7130  END IF
7131  IF (iobp_loc(ip) .eq. 0) THEN ! physical boundary
7132  edet1 = thr-x1*evy+y1*evx
7133  edet2 = thr+x2*evy-y2*evx
7134  IF ((edet1.gt.0.).and.(edet2.gt.0.)) THEN
7135  ! this is the case of waves going towards the boundary ...
7136  iobpd_loc(ith,ip) = 1
7137  ENDIF
7138  ELSE ! water ...
7139  iobpd_loc(ith,ip) = 1
7140  END IF
7141  END DO
7142  END DO
7143  END DO
7144 
7145  DO ith = 1, nth
7146  rtmp = real(iobpd_loc(ith,1:npa))
7147  CALL pdlib_exchange1dreal(rtmp)
7148  iobpd_loc(ith,1:npa) = int(rtmp)
7149  ENDDO
7150  max_iobpd = maxval(iobpd_loc)
7151  min_iobpd = minval(iobpd_loc)
7152 
7153  IF (max_iobpd .gt. 1 .OR. min_iobpd .lt. 0) THEN
7154  WRITE(*,*) 'MAX_IOBPD - MIN_IOBPD', max_iobpd, min_iobpd
7155  stop 'MAX_IOBPD ERRROR'
7156  ENDIF
7157 
7158 #ifdef W3_DEBUGSETUGIOBP
7159  WRITE(740+iaproc,*) 'Calling SETUGIOBP, step 5'
7160  FLUSH(740+iaproc)
7161 #endif
7162  DO ip = 1, npa
7163  IF ( iobpa_loc(ip) .eq. 1 .OR. iobp_loc(ip) .eq. 3 .OR. iobp_loc(ip) .eq. 4) iobpd_loc(:,ip) = 1
7164  END DO
7165 #ifdef W3_DEBUGSETUGIOBP
7166  WRITE(740+iaproc,*) 'Calling SETUGIOBP, step 7'
7167  FLUSH(740+iaproc)
7168 #endif
7169  !--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
7170  ! 3. Updates the reflection direction and sharp / flat shoreline angle
7171 
7172 #ifdef W3_REF1
7173  !
7174  ! Finds the shoreline direction from IOBPD
7175  !
7176  reflc(1,:)= 0.
7177  refld(:,:)= 1
7178  DO ip=1,nx
7179  IF (iobp(ip).EQ.0.AND.mapsta(1,ip).EQ.1) THEN
7180  cossum=0.
7181  sinsum=0.
7182  ndirsum=0.
7183  DO ith=1,nth
7184  cossum=cossum+iobpd(ith,ip)*ecos(ith)
7185  sinsum=sinsum+iobpd(ith,ip)*esin(ith)
7186  ndirsum=ndirsum+iobpd(ith,ip)
7187  END DO
7188  dircoast=atan2(sinsum, cossum)
7189  refld(1,mapfs(1,ip)) = 1+mod(nth+nint(dircoast/dth),nth)
7190  refld(2,mapfs(1,ip)) = 4-max(2,nint(4.*real(ndirsum)/real(nth)))
7191  reflc(1,mapfs(1,ip))= refpars(1)
7192  END IF
7193  END DO
7194 #endif
7195 #ifdef W3_DEBUGSETUGIOBP
7196  WRITE(740+iaproc,*) 'Calling SETUGIOBP, step 8'
7197  FLUSH(740+iaproc)
7198 #endif

References w3adatmd::atrnx, w3adatmd::atrny, w3adatmd::cflxymax, w3adatmd::cg, w3gdatmd::countri, w3adatmd::cx, w3adatmd::cy, w3gdatmd::dth, w3gdatmd::ecos, w3gdatmd::esin, w3odatmd::flbpi, w3idatmd::flcur, w3odatmd::iaproc, w3gdatmd::ien, yowelementpool::ine, w3gdatmd::iobdp_loc, w3gdatmd::iobp, w3gdatmd::iobp_loc, w3gdatmd::iobpa, w3gdatmd::iobpa_loc, w3gdatmd::iobpd, w3gdatmd::iobpd_loc, yownodepool::ipgl, yownodepool::iplg, w3adatmd::itime, w3gdatmd::mapfs, w3gdatmd::mapsta, yowelementpool::ne, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nsea, w3gdatmd::nth, w3gdatmd::ntri, w3gdatmd::nx, w3gdatmd::ny, yowexchangemodule::pdlib_exchange1dreal(), yownodepool::pdlib_ien, yownodepool::pdlib_si, yownodepool::pdlib_tria, w3servmd::strace(), w3odatmd::tbpi0, w3odatmd::tbpin, w3gdatmd::trigp, and w3gdatmd::xfr.

◆ test_mpi_status()

subroutine pdlib_w3profsmd::test_mpi_status ( character(*), intent(in)  string)

Definition at line 1867 of file w3profsmd_pdlib.F90.

1867  !/
1868  !/ +-----------------------------------+
1869  !/ | WAVEWATCH III NOAA/NCEP |
1870  !/ | |
1871  !/ | Aron Roland (BGS IT&E GmbH) |
1872  !/ | Mathieu Dutour-Sikiric (IRB) |
1873  !/ | |
1874  !/ | FORTRAN 90 |
1875  !/ | Last update : 01-June-2018 |
1876  !/ +-----------------------------------+
1877  !/
1878  !/ 01-June-2018 : Origination. ( version 6.04 )
1879  !/
1880  ! 1. Purpose : Check mpi status
1881  ! 2. Method :
1882  ! 3. Parameters :
1883  !
1884  ! Parameter list
1885  ! ----------------------------------------------------------------
1886  ! ----------------------------------------------------------------
1887  !
1888  ! 4. Subroutines used :
1889  !
1890  ! Name Type Module Description
1891  ! ----------------------------------------------------------------
1892  ! STRACE Subr. W3SERVMD Subroutine tracing.
1893  ! ----------------------------------------------------------------
1894  !
1895  ! 5. Called by :
1896  !
1897  ! Name Type Module Description
1898  ! ----------------------------------------------------------------
1899  ! ----------------------------------------------------------------
1900  !
1901  ! 6. Error messages :
1902  ! 7. Remarks
1903  ! 8. Structure :
1904  ! 9. Switches :
1905  !
1906  ! !/S Enable subroutine tracing.
1907  !
1908  ! 10. Source code :
1909  !
1910  !/ ------------------------------------------------------------------- /
1911 
1912  USE w3adatmd, only : mpi_comm_wcmp
1913  USE w3gdatmd, only : gtype, ungtype
1914  USE w3odatmd, only : iaproc, naproc, ntproc
1915  use yowdatapool, only: rtype, istatus
1916 
1917  include "mpif.h"
1918  CHARACTER(*), INTENT(in) :: string
1919  REAL VcollExp(1)
1920  REAL rVect(1)
1921  INTEGER iProc, ierr
1922  WRITE(740+iaproc,*) 'TEST_MPI_STATUS, at string=', string
1923  FLUSH(740+iaproc)
1924  IF (iaproc .gt. naproc) THEN
1925  RETURN
1926  END IF
1927  WRITE(740+iaproc,*) 'After status settings'
1928  FLUSH(740+iaproc)
1929  !
1930  ! Now find global arrays
1931  !
1932  IF (iaproc .eq. 1) THEN
1933  DO iproc=2,naproc
1934  CALL mpi_recv(rvect,1,mpi_real, iproc-1, 37, mpi_comm_wcmp, istatus, ierr)
1935  END DO
1936  ELSE
1937  CALL mpi_send(vcollexp,1,mpi_real, 0, 37, mpi_comm_wcmp, ierr)
1938  END IF
1939  WRITE(740+iaproc,*) 'Leaving the TEST_MPI_STATUS'
1940  FLUSH(740+iaproc)

References w3gdatmd::gtype, w3odatmd::iaproc, include(), yowdatapool::istatus, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, w3odatmd::ntproc, yowdatapool::rtype, and w3gdatmd::ungtype.

Referenced by w3initmd::w3init().

◆ write_var_to_text_file()

subroutine pdlib_w3profsmd::write_var_to_text_file ( real, dimension(nspec, npa), intent(in)  TheArr,
character(*), intent(in)  eFile 
)

Definition at line 2950 of file w3profsmd_pdlib.F90.

2950  !/
2951  !/ +-----------------------------------+
2952  !/ | WAVEWATCH III NOAA/NCEP |
2953  !/ | |
2954  !/ | Aron Roland (BGS IT&E GmbH) |
2955  !/ | Mathieu Dutour-Sikiric (IRB) |
2956  !/ | |
2957  !/ | FORTRAN 90 |
2958  !/ | Last update : 01-June-2018 |
2959  !/ +-----------------------------------+
2960  !/
2961  !/ 01-June-2018 : Origination. ( version 6.04 )
2962  !/
2963  ! 1. Purpose : Source code for parallel debugging
2964  ! 2. Method :
2965  ! 3. Parameters :
2966  !
2967  ! Parameter list
2968  ! ----------------------------------------------------------------
2969  ! ----------------------------------------------------------------
2970  !
2971  ! 4. Subroutines used :
2972  !
2973  ! Name Type Module Description
2974  ! ----------------------------------------------------------------
2975  ! STRACE Subr. W3SERVMD Subroutine tracing.
2976  ! ----------------------------------------------------------------
2977  !
2978  ! 5. Called by :
2979  !
2980  ! Name Type Module Description
2981  ! ----------------------------------------------------------------
2982  ! ----------------------------------------------------------------
2983  !
2984  ! 6. Error messages :
2985  ! 7. Remarks
2986  ! 8. Structure :
2987  ! 9. Switches :
2988  !
2989  ! !/S Enable subroutine tracing.
2990  !
2991  ! 10. Source code :
2992  !
2993  !/ ------------------------------------------------------------------- /
2994 #ifdef W3_S
2995  USE w3servmd, only: strace
2996 #endif
2997  !
2998  USE w3gdatmd, only : nk, nth
2999  USE w3wdatmd, only : va
3000  USE w3gdatmd, only : nspec, nx, ny, nseal, mapfs
3001  USE w3adatmd, only : mpi_comm_wcmp
3002  USE w3gdatmd, only : gtype, ungtype
3003  USE w3odatmd, only : iaproc, naproc, ntproc
3004  use yowdatapool, only: rtype, istatus
3005  USE yownodepool, only: npa, iplg, np
3006  USE w3parall, only: init_get_isea
3007 
3008  include "mpif.h"
3009  CHARACTER(*), INTENT(in) :: eFile
3010  REAL, INTENT(in) :: TheARR(NSPEC, npa)
3011  !
3012  REAL Vcoll(NSPEC,NX), VcollExp(NSPEC*NX), rVect(NSPEC*NX)
3013  REAL CoherencyError, eVal1, eVal2, eErr
3014  INTEGER rStatus(NX), Status(NX)
3015  INTEGER JSEA, ISEA, iProc, I, IX, ierr, ISP, IP, IP_glob
3016  INTEGER nbIncorr
3017  INTEGER ITH, IK
3018  INTEGER fhndl
3019  REAL eSum
3020  IF (iaproc .gt. naproc) THEN
3021  RETURN
3022  END IF
3023  IF (gtype .ne. ungtype) THEN
3024  RETURN
3025  END IF
3026  vcollexp=0
3027  status=0
3028  DO ip=1,np
3029  ip_glob=iplg(ip)
3030  DO isp=1,nspec
3031  vcollexp(isp+nspec*(ip_glob-1))=thearr(isp,ip)
3032  END DO
3033  status(ip_glob)=1
3034  END DO
3035  !
3036  ! Now find global arrays
3037  !
3038  coherencyerror=0
3039  IF (iaproc .eq. 1) THEN
3040  DO iproc=2,naproc
3041  CALL mpi_recv(rvect ,nspec*nx,mpi_double , iproc-1, 37, mpi_comm_wcmp, istatus, ierr)
3042  CALL mpi_recv(rstatus,nx ,mpi_integer, iproc-1, 43, mpi_comm_wcmp, istatus, ierr)
3043  DO i=1,nx
3044  IF (rstatus(i) .eq. 1) THEN
3045  DO isp=1,nspec
3046  eval1=vcollexp(isp+nspec*(i-1))
3047  eval2=rvect(isp+nspec*(i-1))
3048  vcollexp(isp+nspec*(i-1))=rvect(isp+nspec*(i-1))
3049  IF (status(i) .eq. 1) THEN
3050  eerr=abs(eval1 - eval2)
3051  coherencyerror = coherencyerror + eerr
3052  ELSE
3053  vcollexp(isp+nspec*(i-1))=eval2
3054  END IF
3055  END DO
3056  status(i)=1
3057  END IF
3058  END DO
3059  END DO
3060  ELSE
3061  CALL mpi_send(vcollexp,nspec*nx,mpi_double , 0, 37, mpi_comm_wcmp, ierr)
3062  CALL mpi_send(status ,nx ,mpi_integer, 0, 43, mpi_comm_wcmp, ierr)
3063  END IF
3064  IF (iaproc .eq. 1) THEN
3065  DO i=1,nx
3066  DO isp=1,nspec
3067  vcoll(isp,i)=vcollexp(isp + nspec*(i-1))
3068  END DO
3069  END DO
3070  OPEN(fhndl, file=efile)
3071  DO ix=1,nx
3072  esum=sum(vcoll(:,ix))
3073  WRITE(fhndl,*) 'IX=', ix, 'eSum=', esum
3074  END DO
3075  CLOSE(fhndl)
3076  END IF
3077  !/
3078  !/ End of W3XYPFSN ----------------------------------------------------- /
3079  !/

References file(), w3gdatmd::gtype, w3odatmd::iaproc, include(), w3parall::init_get_isea(), yownodepool::iplg, yowdatapool::istatus, w3gdatmd::mapfs, w3adatmd::mpi_comm_wcmp, w3odatmd::naproc, w3gdatmd::nk, yownodepool::np, yownodepool::npa, w3gdatmd::nseal, w3gdatmd::nspec, w3gdatmd::nth, w3odatmd::ntproc, w3gdatmd::nx, w3gdatmd::ny, yowdatapool::rtype, w3servmd::strace(), w3gdatmd::ungtype, and w3wdatmd::va.

Variable Documentation

◆ aspar_diag_all

real, dimension(:,:), allocatable pdlib_w3profsmd::aspar_diag_all

◆ aspar_diag_sources

real, dimension(:,:), allocatable pdlib_w3profsmd::aspar_diag_sources

Definition at line 114 of file w3profsmd_pdlib.F90.

◆ aspar_jac

real, dimension(:,:), allocatable pdlib_w3profsmd::aspar_jac

◆ b_jac

◆ cad_the

real, dimension(:,:), allocatable pdlib_w3profsmd::cad_the

Definition at line 115 of file w3profsmd_pdlib.F90.

115  REAL, ALLOCATABLE :: CAD_THE(:,:), CAS_SIG(:,:)

Referenced by calcarray_jacobi_spectral_1(), calcarray_jacobi_spectral_2(), jacobi_finalize(), jacobi_init(), and pdlib_jacobi_gauss_seidel_block().

◆ cas_sig

real, dimension(:,:), allocatable pdlib_w3profsmd::cas_sig

◆ cofrm4

real, dimension(:), allocatable pdlib_w3profsmd::cofrm4

Definition at line 118 of file w3profsmd_pdlib.F90.

118  REAL, ALLOCATABLE :: COFRM4(:)

Referenced by pdlib_init().

◆ cwnb_sig_m2

real, dimension(:,:), allocatable pdlib_w3profsmd::cwnb_sig_m2

Definition at line 116 of file w3profsmd_pdlib.F90.

116  REAL, ALLOCATABLE :: CWNB_SIG_M2(:,:)

Referenced by calcarray_jacobi_spectral_1(), calcarray_jacobi_spectral_2(), jacobi_finalize(), jacobi_init(), and pdlib_jacobi_gauss_seidel_block().

◆ dtsi

real*8, dimension(:), allocatable pdlib_w3profsmd::dtsi

Definition at line 122 of file w3profsmd_pdlib.F90.

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ flall1

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::flall1

Definition at line 119 of file w3profsmd_pdlib.F90.

119  real*8, ALLOCATABLE :: flall1(:,:,:), kelem1(:,:,:)

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ flall2

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::flall2

Definition at line 120 of file w3profsmd_pdlib.F90.

120  real*8, ALLOCATABLE :: flall2(:,:,:), kelem2(:,:,:)

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ flall3

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::flall3

Definition at line 121 of file w3profsmd_pdlib.F90.

121  real*8, ALLOCATABLE :: flall3(:,:,:), kelem3(:,:,:)

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ freqshiftmethod

integer pdlib_w3profsmd::freqshiftmethod = 2

Definition at line 125 of file w3profsmd_pdlib.F90.

125  INTEGER :: FreqShiftMethod = 2

Referenced by calcarray_jacobi_spectral_1(), calcarray_jacobi_spectral_2(), jacobi_finalize(), jacobi_init(), and pdlib_jacobi_gauss_seidel_block().

◆ fsgeoadvect

logical pdlib_w3profsmd::fsgeoadvect

◆ ient

integer, save pdlib_w3profsmd::ient = 0

Definition at line 99 of file w3profsmd_pdlib.F90.

99  INTEGER, SAVE :: IENT = 0

Referenced by pdlib_w3xypug().

◆ is0_pdlib

integer, dimension(:), allocatable pdlib_w3profsmd::is0_pdlib

Definition at line 124 of file w3profsmd_pdlib.F90.

124  INTEGER, ALLOCATABLE :: IS0_pdlib(:)

Referenced by pdlib_init().

◆ iter

integer, dimension(:), allocatable pdlib_w3profsmd::iter

Definition at line 123 of file w3profsmd_pdlib.F90.

123  INTEGER, ALLOCATABLE :: ITER(:)

Referenced by block_solver_explicit_init(), pdlib_explicit_block(), pdlib_w3xypfsfct2(), pdlib_w3xypfsn2(), and pdlib_w3xypfspsi2().

◆ kelem1

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::kelem1

Definition at line 119 of file w3profsmd_pdlib.F90.

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ kelem2

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::kelem2

Definition at line 120 of file w3profsmd_pdlib.F90.

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ kelem3

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::kelem3

Definition at line 121 of file w3profsmd_pdlib.F90.

Referenced by block_solver_explicit_init(), and pdlib_explicit_block().

◆ linit_output

logical, save pdlib_w3profsmd::linit_output = .TRUE.

Definition at line 127 of file w3profsmd_pdlib.F90.

127  LOGICAL, SAVE :: LINIT_OUTPUT = .true.

Referenced by ergout().

◆ mapsta_hack

logical pdlib_w3profsmd::mapsta_hack = .FALSE.

Definition at line 113 of file w3profsmd_pdlib.F90.

113  LOGICAL :: MAPSTA_HACK = .false.

Referenced by pdlib_w3xypug().

◆ memunit

integer pdlib_w3profsmd::memunit

Definition at line 134 of file w3profsmd_pdlib.F90.

134  integer :: memunit

Referenced by calcarray_jacobi(), calcarray_jacobi2(), calcarray_jacobi_vec(), and pdlib_jacobi_gauss_seidel_block().

◆ nm

real*8, dimension(:,:,:), allocatable pdlib_w3profsmd::nm

Definition at line 122 of file w3profsmd_pdlib.F90.

122  real*8, ALLOCATABLE :: nm(:,:,:), dtsi(:)

Referenced by block_solver_explicit_init(), pdlib_explicit_block(), and pdlib_w3xypfsfct2().

◆ pos_trick

integer, dimension(3,2) pdlib_w3profsmd::pos_trick

Definition at line 129 of file w3profsmd_pdlib.F90.

129  INTEGER :: POS_TRICK(3,2)

Referenced by block_solver_init(), calcarray_jacobi(), calcarray_jacobi2(), calcarray_jacobi3(), calcarray_jacobi4(), and calcarray_jacobi_vec().

◆ rtime

real, save pdlib_w3profsmd::rtime = 0.d0

Definition at line 128 of file w3profsmd_pdlib.F90.

128  REAL, SAVE :: RTIME = 0.d0

Referenced by ergout().

◆ testnode

integer pdlib_w3profsmd::testnode = 1

Definition at line 132 of file w3profsmd_pdlib.F90.

132  INTEGER :: TESTNODE = 1

◆ u_jac

real, dimension(:,:), allocatable pdlib_w3profsmd::u_jac

Definition at line 117 of file w3profsmd_pdlib.F90.

117  REAL, ALLOCATABLE :: U_JAC(:,:)

Referenced by jacobi_finalize(), jacobi_init(), and pdlib_jacobi_gauss_seidel_block().

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::trigp
integer, dimension(:,:), pointer trigp
Definition: w3gdatmd.F90:1111
w3gdatmd::nseal
integer, pointer nseal
Definition: w3gdatmd.F90:1097
w3odatmd::tbpi0
integer, dimension(:), pointer tbpi0
Definition: w3odatmd.F90:464
w3timemd::dsec21
real function dsec21(TIME1, TIME2)
Definition: w3timemd.F90:333
yowfunction
Definition: yowfunction.F90:42
w3parall::prop_refraction_pr3
subroutine prop_refraction_pr3(IP, ISEA, DTG, CAD, DoLimiter)
Compute refraction part in matrix alternative approach.
Definition: w3parall.F90:449
include
cmake src_list cmake include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/check_switches.cmake) check_switches("$
Definition: CMakeLists.txt:15
yownodepool::pdlib_ia
integer, dimension(:), allocatable, target, public pdlib_ia
Definition: yownodepool.F90:81
yowexchangemodule::pdlib_exchange1dreal
subroutine, public pdlib_exchange1dreal(U)
exchange values in U.
Definition: yowexchangeModule.F90:251
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3adatmd::nsealm
integer, pointer nsealm
Definition: w3adatmd.F90:686
w3wdatmd::shavetot
logical, dimension(:), pointer shavetot
Definition: w3wdatmd.F90:193
w3gdatmd::ygrd
double precision, dimension(:,:), pointer ygrd
Definition: w3gdatmd.F90:1205
yowelementpool
Definition: yowelementpool.F90:38
yowfunction::pdlib_abort
subroutine pdlib_abort(istat)
Definition: yowfunction.F90:48
w3gdatmd::fspsi
logical, pointer fspsi
Definition: w3gdatmd.F90:1405
w3adatmd
Define data structures to set up wave model auxiliary data for several models simultaneously.
Definition: w3adatmd.F90:26
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3str1md
Module for inclusion of triad nonlinear interaction according to Eldeberky's (1996) Lumped Triad Inte...
Definition: w3str1md.F90:17
w3dispmd::wavnu_local
pure subroutine wavnu_local(SIG, DW, WNL, CGL)
Definition: w3dispmd.F90:456
yowexchangemodule::pdlib_exchange2dreal
subroutine, public pdlib_exchange2dreal(U)
Definition: yowexchangeModule.F90:303
w3gdatmd::ungtype
integer, parameter ungtype
Definition: w3gdatmd.F90:626
w3gdatmd::dmin
real, pointer dmin
Definition: w3gdatmd.F90:1183
w3gdatmd::ntri
integer, pointer ntri
Definition: w3gdatmd.F90:1109
w3wdatmd
Define data structures to set up wave model dynamic data for several models simultaneously.
Definition: w3wdatmd.F90:18
w3gdatmd::mapsta_loc
integer, dimension(:), pointer mapsta_loc
Definition: w3gdatmd.F90:1115
w3adatmd::atrnx
real, dimension(:,:), pointer atrnx
Definition: w3adatmd.F90:578
w3parall::isea_to_jsea
integer, dimension(:), allocatable isea_to_jsea
Definition: w3parall.F90:83
w3dispmd::wavnu3
pure subroutine wavnu3(SI, H, K, CG)
Definition: w3dispmd.F90:347
w3adatmd::cflxymax
real, dimension(:), pointer cflxymax
Definition: w3adatmd.F90:620
w3parall::thr
real, parameter thr
Definition: w3parall.F90:97
w3adatmd::cg
real, dimension(:,:), pointer cg
Definition: w3adatmd.F90:575
w3gdatmd::b_jgs_diff_thr
real(8), pointer b_jgs_diff_thr
Definition: w3gdatmd.F90:1419
yownodepool::pdlib_i_diag
integer, dimension(:), allocatable, target, public pdlib_i_diag
Definition: yownodepool.F90:85
w3gdatmd::ie_cell
integer, dimension(:), pointer ie_cell
Definition: w3gdatmd.F90:1124
w3gdatmd::fsn
logical, pointer fsn
Definition: w3gdatmd.F90:1405
w3gdatmd::iobpd_loc
integer *1, dimension(:,:), pointer iobpd_loc
Definition: w3gdatmd.F90:1116
w3parall::lsloc
logical, parameter lsloc
Definition: w3parall.F90:89
w3adatmd::dw
real, dimension(:), pointer dw
Definition: w3adatmd.F90:584
w3adatmd::u10d
real, dimension(:), pointer u10d
Definition: w3adatmd.F90:584
w3adatmd::atrny
real, dimension(:,:), pointer atrny
Definition: w3adatmd.F90:578
w3odatmd::ntproc
integer, pointer ntproc
Definition: w3odatmd.F90:457
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3gdatmd::xgrd
double precision, dimension(:,:), pointer xgrd
Definition: w3gdatmd.F90:1205
w3sdb1md
Dummy slot for bottom friction source term.
Definition: w3sdb1md.F90:24
w3gdatmd::b_jgs_pmin
real(8), pointer b_jgs_pmin
Definition: w3gdatmd.F90:1418
w3gdatmd::fsrefraction
logical, pointer fsrefraction
Definition: w3gdatmd.F90:1406
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3parall::listispprevdir
integer, dimension(:), allocatable listispprevdir
Definition: w3parall.F90:86
w3wdatmd::time
integer, dimension(:), pointer time
Definition: w3wdatmd.F90:172
w3parall::zero
real, parameter zero
Definition: w3parall.F90:94
w3gdatmd::ecos
real, dimension(:), pointer ecos
Definition: w3gdatmd.F90:1234
w3gdatmd::grids
type(grid), dimension(:), allocatable, target grids
Definition: w3gdatmd.F90:1088
yowexchangemodule::pdlib_exchange2dreal_zero
subroutine, public pdlib_exchange2dreal_zero(U)
Definition: yowexchangeModule.F90:468
w3parall::onesixth
real, parameter onesixth
Definition: w3parall.F90:92
w3odatmd::bbpi0
real, dimension(:,:), pointer bbpi0
Definition: w3odatmd.F90:541
w3gdatmd::ny
integer, pointer ny
Definition: w3gdatmd.F90:1097
yownodepool::iplg
integer, dimension(:), allocatable, public iplg
Node local to global mapping.
Definition: yownodepool.F90:116
w3odatmd::tbpin
integer, dimension(:), pointer tbpin
Definition: w3odatmd.F90:464
w3gdatmd::fssource
logical, pointer fssource
Definition: w3gdatmd.F90:1406
w3gdatmd::iobp_loc
integer *2, dimension(:), pointer iobp_loc
Definition: w3gdatmd.F90:1117
yownodepool::npa
integer, public npa
number of ghost + resident nodes this partition holds
Definition: yownodepool.F90:99
yowpdlibmain::initfromgriddim
subroutine, public initfromgriddim(MNP, MNE, INE_global, secDim, MPIcomm)
Definition: yowpdlibmain.F90:66
w3gdatmd::dsip
real, dimension(:), pointer dsip
Definition: w3gdatmd.F90:1234
w3odatmd::nbi
integer, pointer nbi
Definition: w3odatmd.F90:530
w3gdatmd::iobpa
integer *1, dimension(:), pointer iobpa
Definition: w3gdatmd.F90:1130
w3odatmd::flbpi
logical, pointer flbpi
Definition: w3odatmd.F90:546
w3wdatmd::va
real, dimension(:,:), pointer va
Definition: w3wdatmd.F90:183
w3idatmd::flcur
logical, pointer flcur
Definition: w3idatmd.F90:261
w3gdatmd::b_jgs_maxiter
integer, pointer b_jgs_maxiter
Definition: w3gdatmd.F90:1416
w3gdatmd::iobdp_loc
integer *1, dimension(:), pointer iobdp_loc
Definition: w3gdatmd.F90:1118
yownodepool::pdlib_ccon
integer, dimension(:), allocatable, target, public pdlib_ccon
Definition: yownodepool.F90:81
yownodepool::pdlib_ia_p
integer, dimension(:), allocatable, target, public pdlib_ia_p
Definition: yownodepool.F90:82
w3gdatmd::b_jgs_terminate_difference
logical, pointer b_jgs_terminate_difference
Definition: w3gdatmd.F90:1411
yownodepool::pdlib_si
real(rkind), dimension(:), allocatable, target, public pdlib_si
Definition: yownodepool.F90:80
yowelementpool::ne
integer, public ne
number of local elements
Definition: yowelementpool.F90:48
w3gdatmd::sdbsc
real, pointer sdbsc
Definition: w3gdatmd.F90:1395
yownodepool::np_global
integer, public np_global
number of nodes, global
Definition: yownodepool.F90:89
w3gdatmd::b_jgs_source_nonlinear
logical, pointer b_jgs_source_nonlinear
Definition: w3gdatmd.F90:1422
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3gdatmd::fachfa
real, pointer fachfa
Definition: w3gdatmd.F90:1232
yowrankmodule::ipgl_npa
integer, dimension(:), allocatable, public ipgl_npa
Definition: yowrankModule.F90:70
w3parall::thr8
real *8, parameter thr8
Definition: w3parall.F90:96
w3gdatmd::mapfs
integer, dimension(:,:), pointer mapfs
Definition: w3gdatmd.F90:1163
w3sdb1md::w3sdb1
subroutine w3sdb1(IX, A, DEPTH, EMEAN, FMEAN, WNMEAN, CG, LBREAK, S, D)
Compute depth-induced breaking using Battjes and Janssen bore model approach.
Definition: w3sdb1md.F90:97
w3idatmd::fllev
logical, pointer fllev
Definition: w3idatmd.F90:261
w3gdatmd::esin
real, dimension(:), pointer esin
Definition: w3gdatmd.F90:1234
yownodepool::ipgl
integer, dimension(:), allocatable, public ipgl
Node global to local mapping np_global long.
Definition: yownodepool.F90:120
w3wdatmd::vdtot
real, dimension(:,:), pointer vdtot
Definition: w3wdatmd.F90:191
w3gdatmd::b_jgs_block_gauss_seidel
logical, pointer b_jgs_block_gauss_seidel
Definition: w3gdatmd.F90:1415
w3parall::pdlib_nsealm
integer pdlib_nsealm
Definition: w3parall.F90:82
yownodepool
Has data that belong to nodes.
Definition: yownodepool.F90:39
constants::lpdlib
logical lpdlib
LPDLIB Logical for using the PDLIB library.
Definition: constants.F90:101
w3gdatmd::nk2
integer, pointer nk2
Definition: w3gdatmd.F90:1230
w3gdatmd::nsea
integer, pointer nsea
Definition: w3gdatmd.F90:1097
w3gdatmd::nbnd_map
integer, pointer nbnd_map
Definition: w3gdatmd.F90:1113
w3gdatmd::index_map
integer, dimension(:), pointer index_map
Definition: w3gdatmd.F90:1114
w3servmd
Definition: w3servmd.F90:3
w3wdatmd::vstot
real, dimension(:,:), pointer vstot
Definition: w3wdatmd.F90:191
w3parall::prop_freq_shift
subroutine prop_freq_shift(IP, ISEA, CAS, DMM, DTG)
Compute frequency shift in matrix.
Definition: w3parall.F90:609
w3gdatmd::b_jgs_nlevel
integer, pointer b_jgs_nlevel
Definition: w3gdatmd.F90:1421
yownodepool::pdlib_ja
integer, dimension(:), allocatable, target, public pdlib_ja
Definition: yownodepool.F90:81
yowrankmodule
Provides access to some information of all threads e.g.
Definition: yowrankModule.F90:44
w3parall::onethird
real, parameter onethird
Definition: w3parall.F90:93
yowfunction::computelistnp_listnpa_listiplg
subroutine computelistnp_listnpa_listiplg
Definition: yowfunction.F90:195
w3gdatmd::fsfct
logical, pointer fsfct
Definition: w3gdatmd.F90:1405
constants::tpiinv
real, parameter tpiinv
TPIINV Inverse of 2*Pi.
Definition: constants.F90:74
yowdatapool::rtype
integer, save rtype
Definition: yowdatapool.F90:76
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
yownodepool::pdlib_tria03
real(rkind), dimension(:), allocatable, target, public pdlib_tria03
Definition: yownodepool.F90:80
w3gdatmd::clats
real, dimension(:), pointer clats
Definition: w3gdatmd.F90:1196
w3parall::prop_refraction_pr1
subroutine prop_refraction_pr1(ISEA, DTG, CAD)
Compute refraction part in matrix.
Definition: w3parall.F90:286
w3gdatmd::ien
real(8), dimension(:,:), pointer ien
Definition: w3gdatmd.F90:1122
w3adatmd::cy
real, dimension(:), pointer cy
Definition: w3adatmd.F90:584
w3gdatmd::flsou
logical, pointer flsou
Definition: w3gdatmd.F90:1217
w3parall::imem
integer, parameter imem
Definition: w3parall.F90:90
w3gdatmd::mapsf
integer, dimension(:,:), pointer mapsf
Definition: w3gdatmd.F90:1163
w3odatmd::naproc
integer, pointer naproc
Definition: w3odatmd.F90:457
w3gdatmd::fsnimp
logical, pointer fsnimp
Definition: w3gdatmd.F90:1405
w3gdatmd::optioncall
integer optioncall
Definition: w3gdatmd.F90:1110
yownodepool::np
integer, public np
number of nodes, local
Definition: yownodepool.F90:93
yowdatapool::istatus
integer, dimension(mpi_status_size) istatus
MPI Real Type Shpuld be MPI_REAL8.
Definition: yowdatapool.F90:74
yowdatapool
Has fancy data.
Definition: yowdatapool.F90:39
yowexchangemodule
Has only the ghost nodes assign to a neighbor domain.
Definition: yowexchangeModule.F90:39
w3parall::pdlib_nseal
integer pdlib_nseal
Definition: w3parall.F90:82
w3gdatmd::fsbccfl
logical, pointer fsbccfl
Definition: w3gdatmd.F90:1406
file
file(STRINGS ${CMAKE_BINARY_DIR}/switch switch_strings) separate_arguments(switches UNIX_COMMAND $
Definition: CMakeLists.txt:3
w3gdatmd::facp
real, pointer facp
Definition: w3gdatmd.F90:1245
w3gdatmd::b_jgs_limiter
logical, pointer b_jgs_limiter
Definition: w3gdatmd.F90:1413
w3parall::jx_to_jsea
integer, dimension(:), allocatable jx_to_jsea
Definition: w3parall.F90:83
w3gdatmd::countri
integer, pointer countri
Definition: w3gdatmd.F90:1109
w3gdatmd::iobpd
integer *1, dimension(:,:), pointer iobpd
Definition: w3gdatmd.F90:1130
w3parall::listispprevfreq
integer, dimension(:), allocatable listispprevfreq
Definition: w3parall.F90:87
w3adatmd::wn
real, dimension(:,:), pointer wn
Definition: w3adatmd.F90:575
w3adatmd::u10
real, dimension(:), pointer u10
Definition: w3adatmd.F90:584
w3gdatmd::fstotalexp
logical, pointer fstotalexp
Definition: w3gdatmd.F90:1405
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
yowelementpool::ine
integer, dimension(:,:), allocatable, target, public ine
number of elements of the augmented domain
Definition: yowelementpool.F90:56
w3parall::prop_freq_shift_m2
subroutine prop_freq_shift_m2(IP, ISEA, CWNB_M2, DWNI_M2, DTG)
Compute frequency shift alternative approach.
Definition: w3parall.F90:761
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::gtype
integer, pointer gtype
Definition: w3gdatmd.F90:1094
w3idatmd
Define data structures to set up wave model input data for several models simultaneously.
Definition: w3idatmd.F90:16
w3gdatmd::mapwn
integer, dimension(:), pointer mapwn
Definition: w3gdatmd.F90:1231
w3gdatmd::iobdp
integer *1, dimension(:), pointer iobdp
Definition: w3gdatmd.F90:1130
w3gdatmd::xfr
real, pointer xfr
Definition: w3gdatmd.F90:1232
w3gdatmd::flcy
logical, pointer flcy
Definition: w3gdatmd.F90:1217
w3gdatmd::iobpa_loc
integer *1, dimension(:), pointer iobpa_loc
Definition: w3gdatmd.F90:1119
w3gdatmd::b_jgs_terminate_norm
logical, pointer b_jgs_terminate_norm
Definition: w3gdatmd.F90:1412
w3gdatmd::fte
real, pointer fte
Definition: w3gdatmd.F90:1232
yownodepool::pdlib_tria
real(rkind), dimension(:), allocatable, target, public pdlib_tria
Definition: yownodepool.F90:80
yownodepool::pdlib_posi
integer, dimension(:,:), allocatable, target, public pdlib_posi
Definition: yownodepool.F90:85
w3gdatmd::ccon
integer, dimension(:), pointer ccon
Definition: w3gdatmd.F90:1124
w3parall::init_get_jsea_isproc
subroutine init_get_jsea_isproc(ISEA, JSEA, ISPROC)
Set JSEA for all schemes.
Definition: w3parall.F90:1163
w3gdatmd::iobp
integer *2, dimension(:), pointer iobp
Definition: w3gdatmd.F90:1129
w3gdatmd::si
real(8), dimension(:), pointer si
Definition: w3gdatmd.F90:1122
w3sbt8md
Contains routines for computing dissipation by viscous fluid mud using Dalrymple and Liu (1978) "Thin...
Definition: w3sbt8md.F90:25
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
w3sbt9md
Contains routines for computing dissipation by viscous fluid mud using Ng (2000).
Definition: w3sbt9md.F90:25
w3wdatmd::ust
real, dimension(:), pointer ust
Definition: w3wdatmd.F90:183
w3sbt4md
SHOWEX bottom friction source term (Ardhuin et al.
Definition: w3sbt4md.F90:25
w3gdatmd::flcx
logical, pointer flcx
Definition: w3gdatmd.F90:1217
w3adatmd::mpi_comm_wave
integer, pointer mpi_comm_wave
Definition: w3adatmd.F90:676
w3sbt1md
JONSWAP bottom friction routine.
Definition: w3sbt1md.F90:21
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
w3gdatmd::b_jgs_use_jacobi
logical, pointer b_jgs_use_jacobi
Definition: w3gdatmd.F90:1414
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
w3adatmd::iter
integer, dimension(:,:), pointer iter
Definition: w3adatmd.F90:654
w3gdatmd
Definition: w3gdatmd.F90:16
w3gdatmd::b_jgs_terminate_maxiter
logical, pointer b_jgs_terminate_maxiter
Definition: w3gdatmd.F90:1410
yowpdlibmain
Definition: yowpdlibmain.F90:42
w3gdatmd::refpars
real, dimension(:), pointer refpars
Definition: w3gdatmd.F90:1139
w3gdatmd::b_jgs_norm_thr
real(8), pointer b_jgs_norm_thr
Definition: w3gdatmd.F90:1420
w3gdatmd::pfmove
real, pointer pfmove
Definition: w3gdatmd.F90:1183
yownodepool::pdlib_ien
real(rkind), dimension(:,:), allocatable, target, public pdlib_ien
Definition: yownodepool.F90:80
w3src4md
The 'SHOM/Ifremer' source terms based on P.A.E.M.
Definition: w3src4md.F90:28
w3wdatmd::ustdir
real, dimension(:), pointer ustdir
Definition: w3wdatmd.F90:183
w3gdatmd::countcon
integer, dimension(:), pointer countcon
Definition: w3gdatmd.F90:1124
yownodepool::pdlib_ie_cell2
integer, dimension(:,:), allocatable, target, public pdlib_ie_cell2
Definition: yownodepool.F90:84
w3gdatmd::ftf
real, pointer ftf
Definition: w3gdatmd.F90:1232
yownodepool::pdlib_pos_cell2
integer, dimension(:,:), allocatable, target, public pdlib_pos_cell2
Definition: yownodepool.F90:84
w3adatmd::itime
integer, pointer itime
Definition: w3adatmd.F90:686
w3gdatmd::index_cell
integer, dimension(:), pointer index_cell
Definition: w3gdatmd.F90:1124
w3odatmd::isbpi
integer, dimension(:), pointer isbpi
Definition: w3odatmd.F90:535
w3adatmd::cx
real, dimension(:), pointer cx
Definition: w3adatmd.F90:584
w3gdatmd::nx
integer, pointer nx
Definition: w3gdatmd.F90:1097
w3parall::listispnextfreq
integer, dimension(:), allocatable listispnextfreq
Definition: w3parall.F90:87
w3gdatmd::fsfreqshift
logical, pointer fsfreqshift
Definition: w3gdatmd.F90:1406
w3timemd
Definition: w3timemd.F90:3
w3src4md::w3spr4
subroutine w3spr4(A, CG, WN, EMEAN, FMEAN, FMEAN1, WNMEAN, AMAX, U, UDIR, ifdef W3_FLX5
Calculate mean wave parameters for the use in the source term routines.
Definition: w3src4md.F90:145
w3parall
Parallel routines for implicit solver.
Definition: w3parall.F90:22
w3dispmd
Definition: w3dispmd.F90:3
w3gdatmd::fstotalimp
logical, pointer fstotalimp
Definition: w3gdatmd.F90:1405
w3gdatmd::ftwn
real, pointer ftwn
Definition: w3gdatmd.F90:1232
w3parall::listispnextdir
integer, dimension(:), allocatable listispnextdir
Definition: w3parall.F90:86
w3gdatmd::mapsta
integer, dimension(:,:), pointer mapsta
Definition: w3gdatmd.F90:1163
w3wdatmd::vaold
real, dimension(:,:), pointer vaold
Definition: w3wdatmd.F90:192
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61
yownodepool::pdlib_nnz
integer, public pdlib_nnz
Definition: yownodepool.F90:90
w3parall::init_get_isea
subroutine init_get_isea(ISEA, JSEA)
Set ISEA for all schemes.
Definition: w3parall.F90:1398
w3sic3md
Definition: w3sic3md.F90:3
w3sic1md
Calculate ice source term S_{ice} according to simple methods.
Definition: w3sic1md.F90:23
w3sic2md
Calculate ice dissipation source term S_{ice}.
Definition: w3sic2md.F90:27
w3odatmd::bbpin
real, dimension(:,:), pointer bbpin
Definition: w3odatmd.F90:541
w3adatmd::mpi_comm_wcmp
integer, pointer mpi_comm_wcmp
Definition: w3adatmd.F90:676