My Project
Public Member Functions | List of all members
mod_par::pprint Interface Reference

Public Member Functions

subroutine pprint_arr (IUNIT, VARP, VART, NOW, ILOC, K1, K2, MSG)
 
subroutine pprint_vec (IUNIT, VARP, VART, NOW, ILOC, MSG)
 

Detailed Description

Definition at line 91 of file mod_par.f90.

Member Function/Subroutine Documentation

◆ pprint_arr()

subroutine mod_par::pprint::pprint_arr ( integer, intent(in)  IUNIT,
real(sp), dimension(:,:), intent(in), pointer  VARP,
character(len=*), intent(in)  VART,
type(time), intent(in)  NOW,
integer, intent(in)  ILOC,
integer, intent(in)  K1,
integer, intent(in), optional  K2,
character(len=*), intent(in), optional  MSG 
)

Definition at line 317 of file mod_par.f90.

317  USE control
318  USE lims
319 
320  IMPLICIT NONE
321  TYPE(TIME), INTENT(IN) :: NOW
322  INTEGER, INTENT(IN) :: IUNIT,ILOC,K1
323  INTEGER, INTENT(IN),OPTIONAL :: K2
324  REAL(SP), POINTER, INTENT(IN) :: VARP(:,:)
325  CHARACTER(LEN=*), INTENT(IN) :: VART
326  CHARACTER(LEN=*), INTENT(IN),OPTIONAL :: MSG
327 
328  CHARACTER(LEN=80),parameter :: VAR_E = "element"
329  CHARACTER(LEN=80),parameter :: VAR_N = "node"
330 
331  CHARACTER(LEN=100) :: STRNG
332  CHARACTER(LEN=20) :: short
333 
334  INTEGER :: I,J,K,PROCMAX,II,IBND,Kopt,IERR
335  LOGICAL :: PRINT_PROC
336 
337  !==============================================================================|
338 
339  !------------------------------------------------------------------------------|
340  ! Process Iunit for Errors |
341  !------------------------------------------------------------------------------|
342  IF(iunit /= ipt .and. (iunit < 300 .or. iunit > 7000) )THEN
343  CALL fatal_error('ERROR IN PPRINT',&
344  & 'FILE UNIT < 300 AND UNIT > 7000 ARE RESERVED FOR FVCOM I/O',&
345  & 'PLEASE INCREASE IUNIT TO 300+')
346  END IF
347 
348  !------------------------------------------------------------------------------|
349  ! Process Vartype for Errors |
350  !------------------------------------------------------------------------------|
351  IF(vart /= var_e .AND. vart /= var_n)THEN
352  CALL fatal_error('VART IN PPRINT NOT CORRECT :'//trim(vart),&
353  & 'SHOULD BE "'//trim(var_e)//'" or "'//trim(var_n)//'"')
354  END IF
355 
356  !------------------------------------------------------------------------------|
357  ! Process optional sigma level range |
358  !------------------------------------------------------------------------------|
359 
360  IF(PRESENT(k2)) THEN
361  kopt=k2
362  ELSE
363  kopt=k1
364  END IF
365 
366  !------------------------------------------------------------------------------|
367  ! Process string output |
368  !------------------------------------------------------------------------------|
369  IF(PRESENT(msg)) strng=trim(msg)//"; IINT"
370 
371 
372  IF(abs(iint) .lt. 1000) THEN
373  WRITE(short,'(I5)') iint
374  ELSE IF(abs(iint) .lt. 1000000) THEN
375  WRITE(short,'(I8)') iint
376  ELSE
377  WRITE(short,*) iint
378  END IF
379 
380  IF(use_real_world_time) THEN
381  strng = trim(strng)//trim(short)//", Date/Time:"&
382  &//trim(write_datetime(now,3,timezone))//"; ILOC "
383  ELSE
384  strng = trim(strng)//trim(short)//", Time(s):"
385  WRITE(short,'(f16.8)') seconds(now)
386  strng = trim(strng)//trim(short)//"; ILOC="
387  END IF
388 
389  WRITE(short,'(I8)') iloc
390  strng = trim(strng)//trim(short)//"; VALUES="
391  !------------------------------------------------------------------------------|
392  ! Single Processor Case |
393  !------------------------------------------------------------------------------|
394  IF(nprocs == 1)THEN
395  WRITE(iunit,*) trim(strng)
396  WRITE(iunit,*) (varp(iloc,k),k=k1,kopt)
397  END IF
398 
399  !------------------------------------------------------------------------------|
400  ! Multi Processor Case with Element Based Variable (u,v,ww, etc) |
401  ! Transform to Local Element ID with "ELID" |
402  !------------------------------------------------------------------------------|
403 
404  IF(nprocs /= 1 .AND. vart == var_e .AND. elid(iloc) /= 0)THEN
405 
406  WRITE(iunit,*) trim(strng)
407  WRITE(iunit,*) (varp(elid(iloc),k),k=k1,kopt)
408 
409  END IF
410 
411  !------------------------------------------------------------------------------|
412  ! Multi Processor Case with Node Based Variable (s1,t1,rho1,e1, etc) |
413  ! Transform to Local Node ID with "NLID" |
414  ! If Node is Interprocessor Boundary Node, Choose Processor with Highest |
415  ! ID Number to Write Values to File |
416  !------------------------------------------------------------------------------|
417 
418  IF(nprocs /= 1 .AND. vart == var_n .AND. nlid(iloc) > 0)THEN
419 
420  print_proc = .true.
421  IF(nde_id(nlid(iloc)) == 1)THEN !!BOUNDARY NODE
422 
423  DO ii=1,nbn
424  IF(bn_lst(ii) == iloc) ibnd = ii
425  END DO
426 
427  procmax = 10000
428  DO j=1,nprocs
429  IF(bn_ney(ibnd,j)==1) THEN
430  IF(j < procmax) procmax = j
431  END IF
432  END DO
433 
434  IF(procmax /= myid) print_proc = .false. !!NOT RESPONSIBLE FOR OUTPUT
435  END IF
436 
437  IF(print_proc)THEN
438  WRITE(iunit,*) trim(strng)
439  WRITE(iunit,*) (varp(nlid(iloc),k),k=k1,kopt)
440  END IF
441 
442  END IF
443 
444 
445  RETURN
integer myid
Definition: mod_main.f90:67
integer, target nprocs
Definition: mod_main.f90:72
integer(itime) iint
Definition: mod_main.f90:850
character(len=80) timezone
Definition: mod_main.f90:126
logical use_real_world_time
Definition: mod_main.f90:131
real(dp) function seconds(MJD)
Definition: mod_time.f90:742
subroutine fatal_error(ER1, ER2, ER3, ER4)
Definition: mod_utils.f90:230
integer ipt
Definition: mod_main.f90:922
character(len=80) function write_datetime(mjdin, prec, TZONE)
Definition: mod_time.f90:682

◆ pprint_vec()

subroutine mod_par::pprint::pprint_vec ( integer, intent(in)  IUNIT,
real(sp), dimension(:), intent(in), pointer  VARP,
character(len=*), intent(in)  VART,
type(time), intent(in)  NOW,
integer, intent(in)  ILOC,
character(len=*), intent(in), optional  MSG 
)

Definition at line 166 of file mod_par.f90.

166  USE control
167  USE lims
168 
169  IMPLICIT NONE
170  TYPE(TIME), INTENT(IN) :: NOW
171  INTEGER, INTENT(IN) :: IUNIT,ILOC
172  REAL(SP), POINTER, INTENT(IN) :: VARP(:)
173  CHARACTER(LEN=*), INTENT(IN) :: VART
174  CHARACTER(LEN=*), INTENT(IN),OPTIONAL :: MSG
175 
176  CHARACTER(LEN=80),parameter :: VAR_E = "element"
177  CHARACTER(LEN=80),parameter :: VAR_N = "node"
178 
179  CHARACTER(LEN=100) :: STRNG
180  CHARACTER(LEN=20) :: short
181 
182  INTEGER :: I,J,K,PROCMAX,II,IBND,Kopt,IERR
183  LOGICAL :: PRINT_PROC
184 
185  !==============================================================================|
186 
187  !------------------------------------------------------------------------------|
188  ! Process Iunit for Errors |
189  !------------------------------------------------------------------------------|
190  IF(iunit /= ipt .and. (iunit < 300 .or. iunit > 7000) )THEN
191  CALL fatal_error('ERROR IN PPRINT',&
192  & 'FILE UNIT < 300 AND UNIT > 7000 ARE RESERVED FOR FVCOM I/O',&
193  & 'PLEASE INCREASE IUNIT TO 300+')
194  END IF
195 
196  !------------------------------------------------------------------------------|
197  ! Process Vartype for Errors |
198  !------------------------------------------------------------------------------|
199  IF(vart /= var_e .AND. vart /= var_n)THEN
200  CALL fatal_error('VART IN PPRINT NOT CORRECT :'//trim(vart),&
201  & 'SHOULD BE "'//trim(var_e)//'" or "'//trim(var_n)//'"')
202  END IF
203 
204 
205  !------------------------------------------------------------------------------|
206  ! Process string output |
207  !------------------------------------------------------------------------------|
208  IF(PRESENT(msg)) strng=trim(msg)//"; IINT"
209 
210 
211  IF(abs(iint) .lt. 1000) THEN
212  WRITE(short,'(I5)') iint
213  ELSE IF(abs(iint) .lt. 1000000) THEN
214  WRITE(short,'(I8)') iint
215  ELSE
216  WRITE(short,*) iint
217  END IF
218 
219  IF(use_real_world_time) THEN
220  strng = trim(strng)//trim(short)//", Date/Time:"&
221  &//trim(write_datetime(now,3,timezone))//"; ILOC= "
222  ELSE
223  strng = trim(strng)//trim(short)//", Time(s):"
224  WRITE(short,'(f16.8)') seconds(now)
225  strng = trim(strng)//trim(short)//"; ILOC="
226  END IF
227 
228  WRITE(short,'(I8)') iloc
229  strng = trim(strng)//trim(short)//"; VALUE="
230 
231  !------------------------------------------------------------------------------|
232  ! Single Processor Case |
233  !------------------------------------------------------------------------------|
234  IF(nprocs == 1)THEN
235  WRITE(iunit,*) trim(strng),varp(iloc)
236  END IF
237 
238  !------------------------------------------------------------------------------|
239  ! Multi Processor Case with Element Based Variable (u,v,ww, etc) |
240  ! Transform to Local Element ID with "ELID" |
241  !------------------------------------------------------------------------------|
242 
243  IF(nprocs /= 1 .AND. vart == var_e .AND. elid(iloc) /= 0)THEN
244 
245  WRITE(iunit,*) trim(strng),varp(elid(iloc))
246 
247  END IF
248 
249  !------------------------------------------------------------------------------|
250  ! Multi Processor Case with Node Based Variable (s1,t1,rho1,e1, etc) |
251  ! Transform to Local Node ID with "NLID" |
252  ! If Node is Interprocessor Boundary Node, Choose Processor with Highest |
253  ! ID Number to Write Values to File |
254  !------------------------------------------------------------------------------|
255 
256  IF(nprocs /= 1 .AND. vart == var_n .AND. nlid(iloc) > 0)THEN
257 
258  print_proc = .true.
259  IF(nde_id(nlid(iloc)) == 1)THEN !!BOUNDARY NODE
260 
261  DO ii=1,nbn
262  IF(bn_lst(ii) == iloc) ibnd = ii
263  END DO
264 
265  procmax = 10000
266  DO j=1,nprocs
267  IF(bn_ney(ibnd,j)==1) THEN
268  IF(j < procmax) procmax = j
269  END IF
270  END DO
271 
272  IF(procmax /= myid) print_proc = .false. !!NOT RESPONSIBLE FOR OUTPUT
273  END IF
274 
275  IF(print_proc)THEN
276  WRITE(iunit,*) trim(strng),varp(nlid(iloc))
277  END IF
278 
279  END IF
280 
281 
282 
283  RETURN
integer myid
Definition: mod_main.f90:67
integer, target nprocs
Definition: mod_main.f90:72
integer(itime) iint
Definition: mod_main.f90:850
character(len=80) timezone
Definition: mod_main.f90:126
logical use_real_world_time
Definition: mod_main.f90:131
real(dp) function seconds(MJD)
Definition: mod_time.f90:742
subroutine fatal_error(ER1, ER2, ER3, ER4)
Definition: mod_utils.f90:230
integer ipt
Definition: mod_main.f90:922
character(len=80) function write_datetime(mjdin, prec, TZONE)
Definition: mod_time.f90:682

The documentation for this interface was generated from the following file: