Changeset 15798
- Timestamp:
- 2022-04-25T11:40:55+02:00 (2 years ago)
- Location:
- branches/UKMO/CO6_shelfclimate_fabm_noos/NEMOGCM/NEMO/OPA_SRC
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/CO6_shelfclimate_fabm_noos/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn2d.F90
r7566 r15798 147 147 TYPE(OBC_DATA), INTENT(in) :: dta ! OBC external data 148 148 INTEGER, INTENT(in) :: ib_bdy ! BDY set index 149 REAL(wp), DIMENSION(:,:), INTENT(inout) :: pua2d, pva2d 150 REAL(wp), DIMENSION(:,:), INTENT(in) :: pssh, phur, phvr 149 REAL(wp), DIMENSION(:,:), INTENT(inout) :: pua2d, pva2d ! JT After barotropic velocities 150 REAL(wp), DIMENSION(:,:), INTENT(in) :: pssh, phur, phvr ! JT SSH after, and phur, phvr = inverse of depth of water 151 151 152 152 INTEGER :: jb, igrd ! dummy loop indices -
branches/UKMO/CO6_shelfclimate_fabm_noos/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
r11264 r15798 5 5 !! Ocean diagnostics: Compute the transport trough a sec. 6 6 !!=============================================================== 7 !! History : 7 !! History : 8 8 !! 9 9 !! original : 02/99 (Y Drillet) … … 29 29 !! dia_dct_wri : Write tranports results in ascii files 30 30 !! interp : Compute temperature/salinity/density at U-point or V-point 31 !! 31 !! 32 32 !!---------------------------------------------------------------------- 33 33 !! * Modules used … … 49 49 USE timing ! preformance summary 50 50 USE wrk_nemo ! working arrays 51 51 52 52 53 53 IMPLICIT NONE … … 83 83 INTEGER :: nn_dct_h ! Frequency of computation for NOOS hourly files 84 84 INTEGER :: nn_dctwri_h ! Frequency of output for NOOS hourly files 85 85 86 86 INTEGER, PARAMETER :: nb_class_max = 11 ! maximum number of classes, i.e. depth levels or density classes 87 87 ! JT INTEGER, PARAMETER :: nb_sec_max = 30 ! maximum number of sections … … 95 95 INTEGER, PARAMETER :: nb_3d_vars = 5 96 96 INTEGER, PARAMETER :: nb_2d_vars = 2 97 INTEGER :: nb_sec 97 INTEGER :: nb_sec 98 98 99 99 TYPE POINT_SECTION … … 145 145 !!---------------------------------------------------------------------- 146 146 ! 147 147 148 148 !JT not sure why this is in nemogcm.F90(?) rather than diadct_init... 149 149 !JT it would be good if the nb_sec_max and nb_point_max were controlled by name list variable. 150 151 150 151 152 152 ALLOCATE(transports_3d(nb_3d_vars,nb_sec_max,nb_point_max,jpk), STAT=ierr(1) ) 153 153 ALLOCATE(transports_2d(nb_2d_vars,nb_sec_max,nb_point_max) , STAT=ierr(2) ) … … 156 156 !JT ALLOCATE(z_hr_output(nb_sec_max,24,nb_class_max) , STAT=ierr(5) ) 157 157 ALLOCATE(z_hr_output(nb_sec_max,3,nb_class_max) , STAT=ierr(5) ) 158 158 159 159 diadct_alloc = MAXVAL( ierr ) 160 160 IF( diadct_alloc /= 0 ) CALL ctl_warn('diadct_alloc: failed to allocate arrays') … … 165 165 SUBROUTINE dia_dct_init 166 166 !!--------------------------------------------------------------------- 167 !! *** ROUTINE diadct *** 167 !! *** ROUTINE diadct *** 168 168 !! 169 169 !! ** Purpose: Read the namelist parameters … … 186 186 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdct in configuration namelist', lwp ) 187 187 IF(lwm) WRITE ( numond, namdct ) 188 188 189 189 190 190 IF( ln_NOOS ) THEN … … 200 200 ! 201 201 ! 202 !nn_dct_h=1 ! hard coded for NOOS transects, to give hourly data 202 !nn_dct_h=1 ! hard coded for NOOS transects, to give hourly data 203 203 ! If you want hourly instantaneous values, you only do the calculation every 12 timesteps (if rdt = 300) 204 204 ! and output it every 12 time steps. For this, you set the ln_dct_h to be True, and it calcuates it automatically … … 206 206 ! 207 207 !SELECT CASE( ln_dct_h ) 208 ! CASE(.TRUE.) 208 ! CASE(.TRUE.) 209 209 ! nn_dct_h=3600./rdt 210 210 ! CASE(.FALSE.) 211 211 ! nn_dct_h=1 212 212 !END SELECT 213 213 214 214 IF ( ln_dct_h ) THEN 215 215 nn_dct_h=3600./rdt 216 216 ELSE 217 217 nn_dct_h=1. 218 ENDIF 219 218 ENDIF 219 220 220 !JT write out hourly calculation every hour 221 221 nn_dctwri_h=3600./rdt … … 244 244 245 245 IF ( nn_secdebug .GE. 1 .AND. nn_secdebug .LE. nb_sec_max )THEN 246 WRITE(numout,*)" Debug section number: ", nn_secdebug 246 WRITE(numout,*)" Debug section number: ", nn_secdebug 247 247 ELSE IF ( nn_secdebug == 0 )THEN ; WRITE(numout,*)" No section to debug" 248 248 ELSE IF ( nn_secdebug == -1 )THEN ; WRITE(numout,*)" Debug all sections" … … 254 254 255 255 ENDIF 256 257 256 257 258 258 IF ( ln_NOOS ) THEN 259 259 IF ( ln_dct_calc_noos_25h .or. ln_dct_calc_noos_hr ) CALL readsec … … 298 298 WRITE(numout,*) "" 299 299 WRITE(numout,*) "" 300 300 301 301 WRITE(numout,*) ' <field_group id="noos_cross_section" domain_ref="1point" axis_ref="noos" operation="average">' 302 302 303 303 DO jsec=1,nb_sec 304 304 WRITE (jsec_str, "(I3.3)") jsec 305 305 306 306 WRITE(numout,*) ' <field id="noos_'//jsec_str//'_trans" long_name="' // TRIM(secs(jsec)%name) // ' 25h mean NOOS transport cross-section number: '//jsec_str//' (total, positive, negative)" unit="m^3/s" />' 307 307 WRITE(numout,*) ' <field id="noos_'//jsec_str//'_heat" long_name="' // TRIM(secs(jsec)%name) // ' 25h mean NOOS heat cross-section number: '//jsec_str//' (total, positive, negative)" unit="J/s" />' 308 308 WRITE(numout,*) ' <field id="noos_'//jsec_str//'_salt" long_name="' // TRIM(secs(jsec)%name) // ' 25h mean NOOS salt cross-section number: '//jsec_str//' (total, positive, negative)" unit="g/s" />' 309 309 310 310 ENDDO 311 311 312 312 WRITE(numout,*) ' </field_group>' 313 313 314 314 WRITE(numout,*) "" 315 315 WRITE(numout,*) "" … … 318 318 WRITE(numout,*) "" 319 319 WRITE(numout,*) "" 320 320 321 321 WRITE(numout,*) ' <file_group id="1d" output_freq="1d" output_level="10" enabled=".TRUE.">' 322 322 WRITE(numout,*) "" … … 324 324 DO jsec=1,nb_sec 325 325 WRITE (jsec_str, "(I3.3)") jsec 326 326 327 327 WRITE(numout,*) ' <field field_ref="noos_'//jsec_str//'_trans" />' 328 328 WRITE(numout,*) ' <field field_ref="noos_'//jsec_str//'_heat" />' 329 329 WRITE(numout,*) ' <field field_ref="noos_'//jsec_str//'_salt" />' 330 330 331 331 ENDDO 332 332 WRITE(numout,*) ' </file>' 333 333 WRITE(numout,*) "" 334 334 WRITE(numout,*) ' </file_group>' 335 335 336 336 WRITE(numout,*) "" 337 337 WRITE(numout,*) "" 338 338 WRITE(numout,*) "~~~~~~~~~~~~~~~~~~~~~" 339 339 WRITE(numout,*) "" 340 340 341 341 ENDIF 342 342 ENDIF … … 345 345 ! 346 346 END SUBROUTINE dia_dct_init 347 348 347 348 349 349 SUBROUTINE dia_dct(kt) 350 350 !!--------------------------------------------------------------------- 351 !! *** ROUTINE diadct *** 351 !! *** ROUTINE diadct *** 352 352 !! 353 353 !! Purpose :: Compute section transports and write it in numdct files 354 !! 354 !! 355 355 !! Method :: All arrays initialised to zero in dct_init 356 356 !! Each nn_dct time step call subroutine 'transports' for … … 370 370 INTEGER :: jsec, &! loop on sections 371 371 itotal ! nb_sec_max*nb_type*nb_class_max 372 LOGICAL :: lldebug =.FALSE. ! debug a section 373 374 372 LOGICAL :: lldebug =.FALSE. ! debug a section 373 374 375 375 INTEGER , DIMENSION(1) :: ish ! tmp array for mpp_sum 376 376 INTEGER , DIMENSION(3) :: ish2 ! " 377 REAL(wp), POINTER, DIMENSION(:) :: zwork ! " 377 REAL(wp), POINTER, DIMENSION(:) :: zwork ! " 378 378 REAL(wp), POINTER, DIMENSION(:,:,:):: zsum ! " 379 !!--------------------------------------------------------------------- 380 381 382 379 !!--------------------------------------------------------------------- 380 381 382 383 383 IF( nn_timing == 1 ) CALL timing_start('dia_dct') 384 384 385 385 IF( lk_mpp ) THEN 386 386 itotal = nb_sec_max*nb_type*nb_class_max 387 CALL wrk_alloc( itotal , zwork ) 387 CALL wrk_alloc( itotal , zwork ) 388 388 CALL wrk_alloc( nb_sec_max,nb_type,nb_class_max , zsum ) 389 ENDIF 390 389 ENDIF 390 391 391 ! Initialise arrays 392 zwork(:) = 0.0 392 zwork(:) = 0.0 393 393 zsum(:,:,:) = 0.0 394 394 … … 405 405 WRITE(numout,*) "nb_class_max = ",nb_class_max 406 406 ENDIF 407 408 407 408 409 409 IF ( ln_dct_calc_noos_25h ) THEN 410 410 411 411 ! Compute transport and write only at nn_dctwri 412 412 IF ( MOD(kt,nn_dct)==0 .or. & ! compute transport every nn_dct time steps 413 413 (ln_NOOS .and. kt==nn_it000 ) ) THEN ! also include first time step when calculating NOOS 25 hour averages 414 415 414 415 416 416 417 417 DO jsec=1,nb_sec 418 418 419 419 lldebug=.FALSE. 420 IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. kt==nit000+nn_dct-1 .AND. lwp ) lldebug=.TRUE. 421 422 !Compute transport through section 423 CALL transport(secs(jsec),lldebug,jsec) 424 420 IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. kt==nit000+nn_dct-1 .AND. lwp ) lldebug=.TRUE. 421 422 !Compute transport through section 423 CALL transport(secs(jsec),lldebug,jsec) 424 425 425 426 426 ENDDO 427 427 428 428 IF( MOD(kt,nn_dctwri)==0 )THEN 429 430 429 430 431 431 432 432 IF( lwp .AND. kt==nit000+nn_dctwri-1 ) WRITE(numout,*)" diadct: average and write at kt = ",kt 433 433 434 434 435 !JT 436 !JT 435 !JT 436 !JT 437 437 !JT !! divide arrays by nn_dctwri/nn_dct to obtain average 438 438 !JT transports_3d(:,:,:,:)=transports_3d(:,:,:,:)/(nn_dctwri/nn_dct) 439 439 !JT transports_2d(:,:,:) =transports_2d(:,:,:) /(nn_dctwri/nn_dct) 440 !JT 441 !JT 442 443 444 !JT 440 !JT 441 !JT 442 443 444 !JT 445 445 !JT Not 24 values, but 25! divide by ((nn_dctwri/nn_dct) +1) 446 446 !! divide arrays by nn_dctwri/nn_dct to obtain average … … 452 452 CALL dia_dct_sum(secs(jsec),jsec) 453 453 ENDDO 454 455 !Sum on all procs 454 455 !Sum on all procs 456 456 IF( lk_mpp )THEN 457 457 zsum(:,:,:)=0.0_wp 458 ish(1) = nb_sec_max*nb_type*nb_class_max 458 ish(1) = nb_sec_max*nb_type*nb_class_max 459 459 ish2 = (/nb_sec_max,nb_type,nb_class_max/) 460 460 DO jsec=1,nb_sec ; zsum(jsec,:,:) = secs(jsec)%transport(:,:) ; ENDDO … … 471 471 !IF( lwp .and. ln_NOOS )CALL dia_dct_wri_NOOS(kt,jsec,secs(jsec)) ! use NOOS specific formatting 472 472 IF( ln_NOOS )CALL dia_dct_wri_NOOS(kt,jsec,secs(jsec)) ! use NOOS specific formatting 473 474 473 474 475 475 !nullify transports values after writing 476 476 transports_3d(:,jsec,:,:)=0.0 477 477 transports_2d(:,jsec,: )=0.0 478 secs(jsec)%transport(:,:)=0. 479 480 478 secs(jsec)%transport(:,:)=0. 479 480 481 481 IF ( ln_NOOS ) CALL transport(secs(jsec),lldebug,jsec) ! reinitialise for next 25 hour instantaneous average (overlapping values) 482 482 … … 485 485 ENDDO 486 486 487 ENDIF 487 ENDIF 488 488 489 489 ENDIF 490 490 491 491 ENDIF 492 492 IF ( ln_dct_calc_noos_hr ) THEN … … 496 496 497 497 lldebug=.FALSE. 498 IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. kt==nit000+nn_dct_h-1 .AND. lwp ) lldebug=.TRUE. 499 500 !Compute transport through section 501 CALL transport_h(secs(jsec),lldebug,jsec) 498 IF( (jsec==nn_secdebug .OR. nn_secdebug==-1) .AND. kt==nit000+nn_dct_h-1 .AND. lwp ) lldebug=.TRUE. 499 500 !Compute transport through section 501 CALL transport_h(secs(jsec),lldebug,jsec) 502 502 503 503 ENDDO 504 504 505 505 IF( MOD(kt,nn_dctwri_h)==0 )THEN 506 506 507 IF( lwp .AND. kt==nit000+nn_dctwri_h-1 )WRITE(numout,*)" diadct: average and write hourly files at kt = ",kt 508 507 IF( lwp .AND. kt==nit000+nn_dctwri_h-1 )WRITE(numout,*)" diadct: average and write hourly files at kt = ",kt 508 509 509 !! divide arrays by nn_dctwri/nn_dct to obtain average 510 510 ! … … 520 520 ENDDO 521 521 522 !Sum on all procs 522 !Sum on all procs 523 523 IF( lk_mpp )THEN 524 ish(1) = nb_sec_max*nb_type*nb_class_max 524 ish(1) = nb_sec_max*nb_type*nb_class_max 525 525 ish2 = (/nb_sec_max,nb_type,nb_class_max/) 526 526 DO jsec=1,nb_sec ; zsum(jsec,:,:) = secs(jsec)%transport_h(:,:) ; ENDDO … … 541 541 transports_2d_h(:,jsec,:)=0.0 542 542 secs(jsec)%transport_h(:,:)=0.0 543 543 544 544 ! for hourly mean or hourly instantaneous, you don't initialise! start with zero! 545 545 !IF ( ln_NOOS ) CALL transport_h(secs(jsec),lldebug,jsec) ! reinitialise for next 25 hour instantaneous average (overlapping values) … … 547 547 ENDDO 548 548 549 ENDIF 550 551 ENDIF 552 549 ENDIF 550 551 ENDIF 552 553 553 ENDIF 554 554 555 555 IF( lk_mpp )THEN 556 556 itotal = nb_sec_max*nb_type*nb_class_max 557 CALL wrk_dealloc( itotal , zwork ) 557 CALL wrk_dealloc( itotal , zwork ) 558 558 CALL wrk_dealloc( nb_sec_max,nb_type,nb_class_max , zsum ) 559 ENDIF 559 ENDIF 560 560 561 561 IF( nn_timing == 1 ) CALL timing_stop('dia_dct') … … 563 563 END SUBROUTINE dia_dct 564 564 565 SUBROUTINE readsec 565 SUBROUTINE readsec 566 566 !!--------------------------------------------------------------------- 567 567 !! *** ROUTINE readsec *** 568 568 !! 569 569 !! ** Purpose: 570 !! Read a binary file(section_ijglobal.diadct) 570 !! Read a binary file(section_ijglobal.diadct) 571 571 !! generated by the tools "NEMOGCM/TOOLS/SECTIONS_DIADCT" 572 572 !! … … 579 579 ! heat/salt tranport is actived 580 580 581 INTEGER, DIMENSION(2) :: icoord 581 INTEGER, DIMENSION(2) :: icoord 582 582 CHARACTER(len=160) :: clname !filename 583 583 CHARACTER(len=200) :: cltmp 584 584 CHARACTER(len=200) :: clformat !automatic format 585 TYPE(POINT_SECTION),DIMENSION(nb_point_max) ::coordtemp !contains listpoints coordinates 585 TYPE(POINT_SECTION),DIMENSION(nb_point_max) ::coordtemp !contains listpoints coordinates 586 586 !read in the file 587 587 INTEGER, POINTER, DIMENSION(:) :: directemp !contains listpoints directions … … 596 596 !write(numout,*) 'dct low-level pre open: little endian ' 597 597 !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='LITTLE_ENDIAN') 598 598 599 599 write(numout,*) 'dct low-level pre open: big endian :',nproc,narea 600 600 OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='BIG_ENDIAN') 601 601 602 602 !write(numout,*) 'dct low-level pre open: SWAP ' 603 603 !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='SWAP') 604 604 605 605 !write(numout,*) 'dct low-level pre open: NATIVE ' 606 606 !OPEN(UNIT=107,FILE='section_ijglobal.diadct', FORM='UNFORMATTED', ACCESS='SEQUENTIAL', STATUS='OLD',convert='NATIVE') 607 607 608 608 READ(107) isec 609 609 CLOSE(107) 610 610 611 611 CALL ctl_opn( numdct_in, 'section_ijglobal.diadct', 'OLD', 'UNFORMATTED', 'SEQUENTIAL', -1, numout, .TRUE. ) 612 613 612 613 614 614 !--------------- 615 615 !Read input file 616 616 !--------------- 617 617 618 618 DO jsec=1,nb_sec_max !loop on the nb_sec sections 619 619 620 620 IF ( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) ) & 621 & WRITE(numout,*)'debugging for section number: ',jsec 621 & WRITE(numout,*)'debugging for section number: ',jsec 622 622 623 623 !initialization … … 639 639 !read section's number / name / computing choices / classes / slopeSection / points number 640 640 !----------------------------------------------------------------------------------------- 641 641 642 642 READ(numdct_in,iostat=iost) isec 643 643 IF (iost .NE. 0 ) then 644 644 write(numout,*) 'unable to read section_ijglobal.diadct. iost = ',iost 645 EXIT !end of file 645 EXIT !end of file 646 646 ENDIF 647 648 647 648 649 649 WRITE(cltmp,'(a,i4.4,a,i4.4)')'diadct: read sections : Problem of section number: isec= ',isec,' and jsec= ',jsec 650 651 650 651 652 652 IF( jsec .NE. isec ) CALL ctl_stop( cltmp ) 653 653 … … 670 670 671 671 IF( lwp .AND. ( jsec==nn_secdebug .OR. nn_secdebug==-1 ) )THEN 672 673 WRITE(clformat,'(a,i2,a)') '(A40,', nb_class_max,'(f8.3,1X))' 672 673 WRITE(clformat,'(a,i2,a)') '(A40,', nb_class_max,'(f8.3,1X))' 674 674 675 675 WRITE(numout,*) " Section name : ",TRIM(secs(jsec)%name) … … 685 685 WRITE(numout,clformat)" Temperature classes : ",secs(jsec)%ztem 686 686 WRITE(numout,clformat)" Depth classes : ",secs(jsec)%zlay 687 ENDIF 688 687 ENDIF 688 689 689 690 690 IF( iptglo .NE. 0 )THEN 691 692 !read points'coordinates and directions 691 692 !read points'coordinates and directions 693 693 !-------------------------------------- 694 694 coordtemp(:) = POINT_SECTION(0,0) !list of points read … … 696 696 DO jpt=1,iptglo 697 697 READ(numdct_in)i1,i2 698 coordtemp(jpt)%I = i1 698 coordtemp(jpt)%I = i1 699 699 coordtemp(jpt)%J = i2 700 700 ENDDO 701 701 READ(numdct_in)directemp(1:iptglo) 702 702 703 703 !debug 704 704 !----- … … 707 707 DO jpt=1,iptglo 708 708 WRITE(numout,*)' # I J ',jpt,coordtemp(jpt),directemp(jpt) 709 ENDDO 709 ENDDO 710 710 ENDIF 711 711 712 712 !Now each proc selects only points that are in its domain: 713 713 !-------------------------------------------------------- 714 714 iptloc = 0 !initialize number of points selected 715 715 DO jpt=1,iptglo !loop on listpoint read in the file 716 716 717 717 iiglo=coordtemp(jpt)%I ! global coordinates of the point 718 ijglo=coordtemp(jpt)%J ! " 718 ijglo=coordtemp(jpt)%J ! " 719 719 720 720 IF( iiglo==jpidta .AND. nimpp==1 ) iiglo = 2 721 721 722 722 iiloc=iiglo-jpizoom+1-nimpp+1 ! local coordinates of the point 723 723 ijloc=ijglo-jpjzoom+1-njmpp+1 ! " … … 728 728 729 729 WRITE(*,*)"diadct readsec: assigned proc!",narea,nproc,jpt 730 731 730 731 732 732 iptloc = iptloc + 1 ! count local points 733 733 secs(jsec)%listPoint(iptloc) = POINT_SECTION(mi0(iiglo),mj0(ijglo)) ! store local coordinates … … 736 736 737 737 ENDDO 738 738 739 739 secs(jsec)%nb_point=iptloc !store number of section's points 740 740 … … 792 792 793 793 ENDDO !end of the loop on jsec 794 794 795 795 nb_sec = jsec-1 !number of section read in the file 796 796 … … 812 812 CHARACTER(len=1),INTENT(IN) :: cdind ! = 'I'/'J' 813 813 CHARACTER(len=8),INTENT(IN) :: cdextr ! = 'top_list'/'bot_list' 814 LOGICAL,INTENT(IN) :: ld_debug 814 LOGICAL,INTENT(IN) :: ld_debug 815 815 816 816 !! * Local variables 817 817 INTEGER :: iextr ,& !extremity of listpoint that we verify 818 818 iind ,& !coord of listpoint that we verify 819 itest ,& !indice value of the side of the domain 819 itest ,& !indice value of the side of the domain 820 820 !where points could be redundant 821 821 isgn ,& ! isgn= 1 : scan listpoint from start to end 822 ! isgn=-1 : scan listpoint from end to start 822 ! isgn=-1 : scan listpoint from end to start 823 823 istart,iend !first and last points selected in listpoint 824 824 INTEGER :: jpoint !loop on list points … … 837 837 ELSE ; CALL ctl_stop("removepoints :Wrong value for cdextr") 838 838 ENDIF 839 839 840 840 !which coordinate shall we verify ? 841 841 IF ( cdind=='I' )THEN ; itest=nlei ; iind=1 842 842 ELSE IF ( cdind=='J' )THEN ; itest=nlej ; iind=2 843 ELSE ; CALL ctl_stop("removepoints :Wrong value for cdind") 843 ELSE ; CALL ctl_stop("removepoints :Wrong value for cdind") 844 844 ENDIF 845 845 … … 861 861 ELSE ; EXIT 862 862 ENDIF 863 ENDDO 863 ENDDO 864 864 865 865 IF( cdextr=='bot_list')THEN ; istart=jpoint-1 ; iend=sec%nb_point … … 871 871 sec%direction(1:1+iend-istart) = idirec(istart:iend) 872 872 sec%nb_point = iend-istart+1 873 873 874 874 IF( ld_debug )THEN 875 875 WRITE(numout,*)' Number of points after removepoints :',sec%nb_point … … 889 889 !! 890 890 !! Method :: Loop over each segment, and each vertical level and add the transport 891 !! Be aware : 891 !! Be aware : 892 892 !! One section is a sum of segments 893 893 !! One segment is defined by 2 consecutive points in sec%listPoint 894 894 !! All points of sec%listPoint are positioned on the F-point of the cell 895 !! 896 !! There are two loops: 895 !! 896 !! There are two loops: 897 897 !! loop on the segment between 2 nodes 898 898 !! loop on the level jk … … 906 906 LOGICAL ,INTENT(IN) :: ld_debug 907 907 INTEGER ,INTENT(IN) :: jsec ! numeric identifier of section 908 908 909 909 !! * Local variables 910 INTEGER :: jk,jseg,jclass, &!loop on level/segment/classes 910 INTEGER :: jk,jseg,jclass, &!loop on level/segment/classes 911 911 isgnu , isgnv ! 912 912 REAL(wp):: zumid , zvmid , &!U/V velocity on a cell segment … … 934 934 ! Making sign of the velocities used to calculate the volume transport a function of direction, not slopesection 935 935 ! (isgnu, isgnv) 936 ! 937 ! They vary for each segment of the section. 936 ! 937 ! They vary for each segment of the section. 938 938 ! 939 939 !---------------------------------------------------------------------------------------------------- … … 950 950 ! ---------------- ----------------- --------------- -------------- 951 951 ! 952 ! isgnv=1 direction + 953 ! ______ _____ ______ 954 ! | //| | | direction + 952 ! isgnv=1 direction + 953 ! ______ _____ ______ 954 ! | //| | | direction + 955 955 ! | isgnu=1 // | |isgnu=1 |isgnu=1 /|\ 956 956 ! |_______ // ______| \\ | ---\ | 957 957 ! | | isgnv=-1 \\ | | ---/ direction + ____________ 958 ! | | __\\| | 959 ! | | direction + | isgnv=1 960 ! 958 ! | | __\\| | 959 ! | | direction + | isgnv=1 960 ! 961 961 !---------------------------------------------------------------------------------------------------- 962 962 ! JT isgnu = 1 963 ! JT IF( sec%slopeSection .GT. 0 ) THEN ; isgnv = -1 963 ! JT IF( sec%slopeSection .GT. 0 ) THEN ; isgnv = -1 964 964 ! JT ELSE ; isgnv = 1 965 965 ! JT ENDIF … … 972 972 !--------------------------------------! 973 973 DO jseg=1,MAX(sec%nb_point-1,0) 974 975 974 975 976 976 !JT: Compute sign for velocities: 977 977 978 978 !isgnu = 1 979 979 !isgnv = 1 980 980 ! 981 ! JT changing sign of u and v is dependent on the direction of the section. 981 ! JT changing sign of u and v is dependent on the direction of the section. 982 982 !isgnu = 1 983 983 !isgnv = 1 … … 986 986 !CASE(3) ; isgnu = -1 987 987 !END SELECT 988 989 988 989 990 990 SELECT CASE( sec%direction(jseg) ) 991 CASE(0) 991 CASE(0) 992 992 isgnu = 1 993 993 isgnv = -1 … … 995 995 isgnu = 1 996 996 isgnv = 1 997 CASE(2) 997 CASE(2) 998 998 isgnu = 1 999 999 isgnv = 1 1000 CASE(3) 1000 CASE(3) 1001 1001 isgnu = -1 1002 1002 isgnv = 1 1003 1003 END SELECT 1004 1004 1005 1005 !------------------------------------------------------------------------------------------- 1006 1006 ! Select the appropriate coordinate for computing the velocity of the segment … … 1009 1009 ! CASE(0) Case (2) 1010 1010 ! ------- -------- 1011 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1011 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1012 1012 ! F(i,j)---------#V(i,j)-------F(i+1,j) | 1013 1013 ! --------> | … … 1021 1021 ! | | 1022 1022 ! | listPoint(jseg+1) F(i,j-1) 1023 ! ^ | 1024 ! | | 1025 ! | U(i,j+1) 1026 ! | | Case(1) 1027 ! | | ------ 1028 ! | 1029 ! | listPoint(jseg+1) listPoint(jseg) 1030 ! | F(i-1,j)----------#V(i-1,j) ------#f(i,j) 1023 ! ^ | 1024 ! | | 1025 ! | U(i,j+1) 1026 ! | | Case(1) 1027 ! | | ------ 1028 ! | 1029 ! | listPoint(jseg+1) listPoint(jseg) 1030 ! | F(i-1,j)----------#V(i-1,j) ------#f(i,j) 1031 1031 ! listPoint(jseg) F(i,j) <------- 1032 ! 1032 ! 1033 1033 !------------------------------------------------------------------------------------------- 1034 1034 … … 1043 1043 ! LOOP ON THE LEVEL | 1044 1044 !---------------------------| 1045 !Sum of the transport on the vertical 1045 !Sum of the transport on the vertical 1046 1046 DO jk=1,mbathy(k%I,k%J) 1047 1047 … … 1059 1059 zrhop = interp(k%I,k%J,jk,'U',rhop) 1060 1060 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 1061 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1061 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1062 1062 END SELECT 1063 1063 1064 1064 zfsdep= fsdept(k%I,k%J,jk) 1065 1065 1066 1066 !compute velocity with the correct direction 1067 1067 SELECT CASE( sec%direction(jseg) ) 1068 CASE(0,1) 1068 CASE(0,1) 1069 1069 zumid=0. 1070 1070 zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) … … 1086 1086 ENDIF 1087 1087 #endif 1088 !COMPUTE TRANSPORT 1088 !COMPUTE TRANSPORT 1089 1089 1090 1090 transports_3d(1,jsec,jseg,jk) = transports_3d(1,jsec,jseg,jk) + zTnorm 1091 1091 1092 1092 IF ( sec%llstrpond ) THEN 1093 1093 transports_3d(2,jsec,jseg,jk) = transports_3d(2,jsec,jseg,jk) + zTnorm * zrhoi … … 1101 1101 #if defined key_lim2 || defined key_lim3 1102 1102 1103 !ICE CASE 1103 !ICE CASE 1104 1104 !------------ 1105 1105 IF( sec%ll_ice_section )THEN … … 1118 1118 zumid_ice = isgnu*0.5*(u_ice(k%I+1,k%J)+u_ice(k%I+1,k%J+1)) 1119 1119 END SELECT 1120 1120 1121 1121 zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J) 1122 1122 1123 1123 transports_2d(1,jsec,jseg) = transports_2d(1,jsec,jseg) + (zTnorm)* & 1124 1124 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & … … 1129 1129 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 1130 1130 +zice_surf_pos 1131 1131 1132 1132 ENDIF !end of ice case 1133 1133 #endif 1134 1134 1135 1135 ENDDO !end of loop on the segment 1136 1136 … … 1149 1149 !! 1150 1150 !! Method :: Loop over each segment, and each vertical level and add the transport 1151 !! Be aware : 1151 !! Be aware : 1152 1152 !! One section is a sum of segments 1153 1153 !! One segment is defined by 2 consecutive points in sec%listPoint 1154 1154 !! All points of sec%listPoint are positioned on the F-point of the cell 1155 !! 1156 !! There are two loops: 1155 !! 1156 !! There are two loops: 1157 1157 !! loop on the segment between 2 nodes 1158 1158 !! loop on the level jk … … 1166 1166 LOGICAL ,INTENT(IN) :: ld_debug 1167 1167 INTEGER ,INTENT(IN) :: jsec ! numeric identifier of section 1168 1168 1169 1169 !! * Local variables 1170 INTEGER :: jk,jseg,jclass, &!loop on level/segment/classes 1170 INTEGER :: jk,jseg,jclass, &!loop on level/segment/classes 1171 1171 isgnu , isgnv ! 1172 1172 REAL(wp):: zumid , zvmid , &!U/V velocity on a cell segment … … 1194 1194 ! Making sign of the velocities used to calculate the volume transport a function of direction, not slopesection 1195 1195 ! (isgnu, isgnv) 1196 ! 1197 ! They vary for each segment of the section. 1196 ! 1197 ! They vary for each segment of the section. 1198 1198 ! 1199 1199 !---------------------------------------------------------------------------------------------------- … … 1210 1210 ! ---------------- ----------------- --------------- -------------- 1211 1211 ! 1212 ! isgnv=1 direction + 1213 ! ______ _____ ______ 1214 ! | //| | | direction + 1212 ! isgnv=1 direction + 1213 ! ______ _____ ______ 1214 ! | //| | | direction + 1215 1215 ! | isgnu=1 // | |isgnu=1 |isgnu=1 /|\ 1216 1216 ! |_______ // ______| \\ | ---\ | 1217 1217 ! | | isgnv=-1 \\ | | ---/ direction + ____________ 1218 ! | | __\\| | 1219 ! | | direction + | isgnv=1 1220 ! 1218 ! | | __\\| | 1219 ! | | direction + | isgnv=1 1220 ! 1221 1221 !---------------------------------------------------------------------------------------------------- 1222 1222 ! JT isgnu = 1 1223 ! JT IF( sec%slopeSection .GT. 0 ) THEN ; isgnv = -1 1223 ! JT IF( sec%slopeSection .GT. 0 ) THEN ; isgnv = -1 1224 1224 ! JT ELSE ; isgnv = 1 1225 1225 ! JT ENDIF … … 1232 1232 !--------------------------------------! 1233 1233 DO jseg=1,MAX(sec%nb_point-1,0) 1234 1235 1234 1235 1236 1236 !JT: Compute sign for velocities: 1237 1237 1238 1238 !isgnu = 1 1239 1239 !isgnv = 1 1240 1240 ! 1241 ! JT changing sign of u and v is dependent on the direction of the section. 1241 ! JT changing sign of u and v is dependent on the direction of the section. 1242 1242 !isgnu = 1 1243 1243 !isgnv = 1 … … 1246 1246 !CASE(3) ; isgnu = -1 1247 1247 !END SELECT 1248 1249 1248 1249 1250 1250 SELECT CASE( sec%direction(jseg) ) 1251 CASE(0) 1251 CASE(0) 1252 1252 isgnu = 1 1253 1253 isgnv = -1 … … 1255 1255 isgnu = 1 1256 1256 isgnv = 1 1257 CASE(2) 1257 CASE(2) 1258 1258 isgnu = 1 1259 1259 isgnv = 1 1260 CASE(3) 1260 CASE(3) 1261 1261 isgnu = -1 1262 1262 isgnv = 1 1263 1263 END SELECT 1264 1264 1265 1265 !------------------------------------------------------------------------------------------- 1266 1266 ! Select the appropriate coordinate for computing the velocity of the segment … … 1269 1269 ! CASE(0) Case (2) 1270 1270 ! ------- -------- 1271 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1271 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1272 1272 ! F(i,j)---------#V(i,j)-------F(i+1,j) | 1273 1273 ! --------> | … … 1281 1281 ! | | 1282 1282 ! | listPoint(jseg+1) F(i,j-1) 1283 ! ^ | 1284 ! | | 1285 ! | U(i,j+1) 1286 ! | | Case(1) 1287 ! | | ------ 1288 ! | 1289 ! | listPoint(jseg+1) listPoint(jseg) 1290 ! | F(i-1,j)----------#V(i-1,j) ------#f(i,j) 1283 ! ^ | 1284 ! | | 1285 ! | U(i,j+1) 1286 ! | | Case(1) 1287 ! | | ------ 1288 ! | 1289 ! | listPoint(jseg+1) listPoint(jseg) 1290 ! | F(i-1,j)----------#V(i-1,j) ------#f(i,j) 1291 1291 ! listPoint(jseg) F(i,j) <------- 1292 ! 1292 ! 1293 1293 !------------------------------------------------------------------------------------------- 1294 1294 … … 1303 1303 ! LOOP ON THE LEVEL | 1304 1304 !---------------------------| 1305 !Sum of the transport on the vertical 1305 !Sum of the transport on the vertical 1306 1306 DO jk=1,mbathy(k%I,k%J) 1307 1307 … … 1319 1319 zrhop = interp(k%I,k%J,jk,'U',rhop) 1320 1320 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 1321 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1321 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1322 1322 END SELECT 1323 1323 1324 1324 zfsdep= fsdept(k%I,k%J,jk) 1325 1325 1326 1326 !compute velocity with the correct direction 1327 1327 SELECT CASE( sec%direction(jseg) ) 1328 CASE(0,1) 1328 CASE(0,1) 1329 1329 zumid=0. 1330 1330 zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) … … 1346 1346 ENDIF 1347 1347 #endif 1348 !COMPUTE TRANSPORT 1348 !COMPUTE TRANSPORT 1349 1349 1350 1350 transports_3d_h(1,jsec,jseg,jk) = transports_3d_h(1,jsec,jseg,jk) + zTnorm 1351 1351 1352 1352 IF ( sec%llstrpond ) THEN 1353 1353 transports_3d_h(2,jsec,jseg,jk) = transports_3d_h(2,jsec,jseg,jk) + zTnorm * zrhoi … … 1361 1361 #if defined key_lim2 || defined key_lim3 1362 1362 1363 !ICE CASE 1363 !ICE CASE 1364 1364 !------------ 1365 1365 IF( sec%ll_ice_section )THEN … … 1378 1378 zumid_ice = isgnu*0.5*(u_ice(k%I+1,k%J)+u_ice(k%I+1,k%J+1)) 1379 1379 END SELECT 1380 1380 1381 1381 zTnorm=zumid_ice*e2u(k%I,k%J)+zvmid_ice*e1v(k%I,k%J) 1382 1382 1383 1383 transports_2d_h(1,jsec,jseg) = transports_2d_h(1,jsec,jseg) + (zTnorm)* & 1384 1384 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & … … 1389 1389 (1.0 - frld(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J)) & 1390 1390 +zice_surf_pos 1391 1391 1392 1392 ENDIF !end of ice case 1393 1393 #endif 1394 1394 1395 1395 ENDDO !end of loop on the segment 1396 1396 … … 1398 1398 ! 1399 1399 END SUBROUTINE transport_h 1400 1400 1401 1401 SUBROUTINE dia_dct_sum(sec,jsec) 1402 1402 !!------------------------------------------------------------- 1403 !! Purpose: Average the transport over nn_dctwri time steps 1403 !! Purpose: Average the transport over nn_dctwri time steps 1404 1404 !! and sum over the density/salinity/temperature/depth classes 1405 1405 !! 1406 !! Method: 1406 !! Method: 1407 1407 !! Sum over relevant grid cells to obtain values 1408 1408 !! for each 1409 !! There are several loops: 1409 !! There are several loops: 1410 1410 !! loop on the segment between 2 nodes 1411 1411 !! loop on the level jk … … 1416 1416 !! computed on each proc. 1417 1417 !! On each proc,transport is equal to the sum of transport computed through 1418 !! segments linking each point of sec%listPoint with the next one. 1418 !! segments linking each point of sec%listPoint with the next one. 1419 1419 !! 1420 1420 !!------------------------------------------------------------- … … 1424 1424 1425 1425 TYPE(POINT_SECTION) :: k 1426 INTEGER :: jk,jseg,jclass !loop on level/segment/classes 1426 INTEGER :: jk,jseg,jclass !loop on level/segment/classes 1427 1427 REAL(wp) :: ztn, zsn, zrhoi, zrhop, zsshn, zfsdep ! temperature/salinity/ssh/potential density /depth at u/v point 1428 1428 !!------------------------------------------------------------- 1429 1429 1430 1430 !! Sum the relevant segments to obtain values for each class 1431 IF(sec%nb_point .NE. 0)THEN 1431 IF(sec%nb_point .NE. 0)THEN 1432 1432 1433 1433 !--------------------------------------! … … 1435 1435 !--------------------------------------! 1436 1436 DO jseg=1,MAX(sec%nb_point-1,0) 1437 1437 1438 1438 !------------------------------------------------------------------------------------------- 1439 1439 ! Select the appropriate coordinate for computing the velocity of the segment … … 1441 1441 ! CASE(0) Case (2) 1442 1442 ! ------- -------- 1443 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1443 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1444 1444 ! F(i,j)----------V(i+1,j)-------F(i+1,j) | 1445 1445 ! | … … 1453 1453 ! | | 1454 1454 ! | listPoint(jseg+1) F(i,j-1) 1455 ! | 1456 ! | 1457 ! U(i,j+1) 1458 ! | Case(1) 1459 ! | ------ 1460 ! | 1461 ! | listPoint(jseg+1) listPoint(jseg) 1462 ! | F(i-1,j)-----------V(i,j) -------f(jseg) 1455 ! | 1456 ! | 1457 ! U(i,j+1) 1458 ! | Case(1) 1459 ! | ------ 1460 ! | 1461 ! | listPoint(jseg+1) listPoint(jseg) 1462 ! | F(i-1,j)-----------V(i,j) -------f(jseg) 1463 1463 ! listPoint(jseg) F(i,j) 1464 ! 1464 ! 1465 1465 !------------------------------------------------------------------------------------------- 1466 1466 … … 1475 1475 ! LOOP ON THE LEVEL | 1476 1476 !---------------------------| 1477 !Sum of the transport on the vertical 1477 !Sum of the transport on the vertical 1478 1478 DO jk=1,mbathy(k%I,k%J) 1479 1479 … … 1491 1491 zrhop = interp(k%I,k%J,jk,'U',rhop) 1492 1492 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 1493 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1493 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1494 1494 END SELECT 1495 1495 1496 zfsdep= fsdept(k%I,k%J,jk) 1497 1496 zfsdep= fsdept(k%I,k%J,jk) 1497 1498 1498 !------------------------------- 1499 1499 ! LOOP ON THE DENSITY CLASSES | … … 1501 1501 !The computation is made for each density/temperature/salinity/depth class 1502 1502 DO jclass=1,MAX(1,sec%nb_class-1) 1503 1503 1504 1504 !----------------------------------------------! 1505 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 1505 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 1506 1506 !----------------------------------------------! 1507 1507 1508 1508 IF ( ( & 1509 1509 ((( zrhop .GE. (sec%zsigp(jclass)+1000. )) .AND. & … … 1530 1530 !SUM THE TRANSPORTS FOR EACH CLASSES FOR THE POSITIVE AND NEGATIVE DIRECTIONS 1531 1531 !---------------------------------------------------------------------------- 1532 IF (transports_3d(1,jsec,jseg,jk) .GE. 0.0) THEN 1532 IF (transports_3d(1,jsec,jseg,jk) .GE. 0.0) THEN 1533 1533 sec%transport(1,jclass) = sec%transport(1,jclass)+transports_3d(1,jsec,jseg,jk) 1534 1534 ELSE … … 1577 1577 1578 1578 ENDIF ! end of test if point is in class 1579 1579 1580 1580 ENDDO ! end of loop on the classes 1581 1581 … … 1584 1584 #if defined key_lim2 || defined key_lim3 1585 1585 1586 !ICE CASE 1586 !ICE CASE 1587 1587 IF( sec%ll_ice_section )THEN 1588 1588 … … 1601 1601 ENDIF !end of ice case 1602 1602 #endif 1603 1603 1604 1604 ENDDO !end of loop on the segment 1605 1605 … … 1611 1611 1612 1612 END SUBROUTINE dia_dct_sum 1613 1613 1614 1614 SUBROUTINE dia_dct_sum_h(sec,jsec) 1615 1615 !!------------------------------------------------------------- 1616 1616 !! Exactly as dia_dct_sum but for hourly files containing data summed at each time step 1617 1617 !! 1618 !! Purpose: Average the transport over nn_dctwri time steps 1618 !! Purpose: Average the transport over nn_dctwri time steps 1619 1619 !! and sum over the density/salinity/temperature/depth classes 1620 1620 !! 1621 !! Method: 1621 !! Method: 1622 1622 !! Sum over relevant grid cells to obtain values 1623 1623 !! for each 1624 !! There are several loops: 1624 !! There are several loops: 1625 1625 !! loop on the segment between 2 nodes 1626 1626 !! loop on the level jk … … 1631 1631 !! computed on each proc. 1632 1632 !! On each proc,transport is equal to the sum of transport computed through 1633 !! segments linking each point of sec%listPoint with the next one. 1633 !! segments linking each point of sec%listPoint with the next one. 1634 1634 !! 1635 1635 !!------------------------------------------------------------- … … 1639 1639 1640 1640 TYPE(POINT_SECTION) :: k 1641 INTEGER :: jk,jseg,jclass !loop on level/segment/classes 1641 INTEGER :: jk,jseg,jclass !loop on level/segment/classes 1642 1642 REAL(wp) :: ztn, zsn, zrhoi, zrhop, zsshn, zfsdep ! temperature/salinity/ssh/potential density /depth at u/v point 1643 1643 !!------------------------------------------------------------- 1644 1644 1645 1645 !! Sum the relevant segments to obtain values for each class 1646 IF(sec%nb_point .NE. 0)THEN 1646 IF(sec%nb_point .NE. 0)THEN 1647 1647 1648 1648 !--------------------------------------! … … 1650 1650 !--------------------------------------! 1651 1651 DO jseg=1,MAX(sec%nb_point-1,0) 1652 1652 1653 1653 !------------------------------------------------------------------------------------------- 1654 1654 ! Select the appropriate coordinate for computing the velocity of the segment … … 1656 1656 ! CASE(0) Case (2) 1657 1657 ! ------- -------- 1658 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1658 ! listPoint(jseg) listPoint(jseg+1) listPoint(jseg) F(i,j) 1659 1659 ! F(i,j)----------V(i+1,j)-------F(i+1,j) | 1660 1660 ! | … … 1668 1668 ! | | 1669 1669 ! | listPoint(jseg+1) F(i,j-1) 1670 ! | 1671 ! | 1672 ! U(i,j+1) 1673 ! | Case(1) 1674 ! | ------ 1675 ! | 1676 ! | listPoint(jseg+1) listPoint(jseg) 1677 ! | F(i-1,j)-----------V(i,j) -------f(jseg) 1670 ! | 1671 ! | 1672 ! U(i,j+1) 1673 ! | Case(1) 1674 ! | ------ 1675 ! | 1676 ! | listPoint(jseg+1) listPoint(jseg) 1677 ! | F(i-1,j)-----------V(i,j) -------f(jseg) 1678 1678 ! listPoint(jseg) F(i,j) 1679 ! 1679 ! 1680 1680 !------------------------------------------------------------------------------------------- 1681 1681 … … 1690 1690 ! LOOP ON THE LEVEL | 1691 1691 !---------------------------| 1692 !Sum of the transport on the vertical 1692 !Sum of the transport on the vertical 1693 1693 DO jk=1,mbathy(k%I,k%J) 1694 1694 … … 1706 1706 zrhop = interp(k%I,k%J,jk,'U',rhop) 1707 1707 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 1708 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1708 zsshn = 0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J) ) * umask(k%I,k%J,1) 1709 1709 END SELECT 1710 1710 1711 1711 zfsdep= fsdept(k%I,k%J,jk) 1712 1712 1713 1713 !------------------------------- 1714 1714 ! LOOP ON THE DENSITY CLASSES | … … 1718 1718 1719 1719 !----------------------------------------------! 1720 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 1720 !TEST ON THE DENSITY/SALINITY/TEMPERATURE/LEVEL! 1721 1721 !----------------------------------------------! 1722 1722 1723 1723 IF ( ( & 1724 1724 ((( zrhop .GE. (sec%zsigp(jclass)+1000. )) .AND. & … … 1745 1745 !SUM THE TRANSPORTS FOR EACH CLASSES FOR THE POSITIVE AND NEGATIVE DIRECTIONS 1746 1746 !---------------------------------------------------------------------------- 1747 IF (transports_3d_h(1,jsec,jseg,jk) .GE. 0.0) THEN 1747 IF (transports_3d_h(1,jsec,jseg,jk) .GE. 0.0) THEN 1748 1748 sec%transport_h(1,jclass) = sec%transport_h(1,jclass)+transports_3d_h(1,jsec,jseg,jk) 1749 1749 ELSE … … 1792 1792 1793 1793 ENDIF ! end of test if point is in class 1794 1794 1795 1795 ENDDO ! end of loop on the classes 1796 1796 … … 1799 1799 #if defined key_lim2 || defined key_lim3 1800 1800 1801 !ICE CASE 1801 !ICE CASE 1802 1802 IF( sec%ll_ice_section )THEN 1803 1803 … … 1816 1816 ENDIF !end of ice case 1817 1817 #endif 1818 1818 1819 1819 ENDDO !end of loop on the segment 1820 1820 … … 1826 1826 1827 1827 END SUBROUTINE dia_dct_sum_h 1828 1828 1829 1829 SUBROUTINE dia_dct_wri_NOOS(kt,ksec,sec) 1830 1830 !!------------------------------------------------------------- 1831 !! Write transport output in numdct using NOOS formatting 1832 !! 1831 !! Write transport output in numdct using NOOS formatting 1832 !! 1833 1833 !! Purpose: Write transports in ascii files 1834 !! 1834 !! 1835 1835 !! Method: 1836 1836 !! 1. Write volume transports in "volume_transport" 1837 !! Unit: Sv : area * Velocity / 1.e6 1838 !! 1837 !! Unit: Sv : area * Velocity / 1.e6 1838 !! 1839 1839 !! 2. Write heat transports in "heat_transport" 1840 1840 !! Unit: Peta W : area * Velocity * T * rhau * Cp / 1.e15 1841 !! 1841 !! 1842 1842 !! 3. Write salt transports in "salt_transport" 1843 1843 !! Unit: 10^9 g m^3 / s : area * Velocity * S / 1.e6 1844 1844 !! 1845 !!------------------------------------------------------------- 1845 !!------------------------------------------------------------- 1846 1846 !!arguments 1847 1847 INTEGER, INTENT(IN) :: kt ! time-step 1848 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 1848 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 1849 1849 INTEGER ,INTENT(IN) :: ksec ! section number 1850 1850 1851 1851 !!local declarations 1852 1852 INTEGER :: jclass,ji ! Dummy loop 1853 CHARACTER(len=2) :: classe ! Classname 1854 1853 CHARACTER(len=2) :: classe ! Classname 1854 1855 1855 REAL(wp) :: zbnd1,zbnd2 ! Class bounds 1856 1856 REAL(wp) :: zslope ! section's slope coeff 1857 1857 ! 1858 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 1859 CHARACTER(len=3) :: noos_sect_name ! Classname 1858 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 1859 CHARACTER(len=3) :: noos_sect_name ! Classname 1860 1860 CHARACTER(len=25) :: noos_var_sect_name 1861 1861 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: noos_iom_dummy 1862 1862 INTEGER :: IERR 1863 1863 1864 1864 REAL(wp), DIMENSION(3) :: tmp_iom_output 1865 1865 REAL(wp) :: max_iom_val 1866 1867 !!------------------------------------------------------------- 1868 1869 1870 1866 1867 !!------------------------------------------------------------- 1868 1869 1870 1871 1871 IF( lwp ) THEN 1872 1872 WRITE(numout,*) " " 1873 1873 WRITE(numout,*) "dia_dct_wri_NOOS: write transports through sections at timestep: ", kt 1874 1874 WRITE(numout,*) "~~~~~~~~~~~~~~~~~~~~~" 1875 ENDIF 1876 1877 CALL wrk_alloc(nb_type , zsumclasses ) 1875 ENDIF 1876 1877 CALL wrk_alloc(nb_type , zsumclasses ) 1878 1878 1879 1879 zsumclasses(:)=0._wp 1880 zslope = sec%slopeSection 1881 1880 zslope = sec%slopeSection 1881 1882 1882 IF( lwp ) THEN 1883 1883 IF ( ln_dct_ascii ) THEN … … 1885 1885 ELSE 1886 1886 WRITE(numdct_NOOS) nyear,nmonth,nday,ksec-1,sec%nb_class-1,sec%name 1887 ENDIF 1887 ENDIF 1888 1888 ENDIF 1889 1890 ! Sum all classes together, to give one values per type (pos tran, neg vol trans etc...). 1889 1890 ! Sum all classes together, to give one values per type (pos tran, neg vol trans etc...). 1891 1891 DO jclass=1,MAX(1,sec%nb_class-1) 1892 1892 zsumclasses(1:nb_type)=zsumclasses(1:nb_type)+sec%transport(1:nb_type,jclass) 1893 1893 ENDDO 1894 1894 1895 1895 classe = 'total ' 1896 1896 zbnd1 = 0._wp 1897 1897 zbnd2 = 0._wp 1898 1899 1900 1898 1899 1900 1901 1901 write (noos_sect_name, "(I0.3)") ksec 1902 1902 1903 1903 IF ( ln_dct_iom_cont ) THEN 1904 1904 max_iom_val = 1.e10 … … 1906 1906 IF( ierr /= 0 ) CALL ctl_stop( 'dia_dct_wri_NOOS: failed to allocate noos_iom_dummy array' ) 1907 1907 ENDIF 1908 1908 1909 1909 ! JT 1910 1910 ! JT … … 1920 1920 ! 1921 1921 ! IF ( zslope .gt. 0._wp .and. zslope .ne. 10000._wp ) THEN 1922 ! 1922 ! 1923 1923 ! IF( lwp ) THEN 1924 1924 ! WRITE(numdct_NOOS,'(9e12.4E2)') -(zsumclasses( 1)+zsumclasses( 2)), -zsumclasses( 2),-zsumclasses( 1), & 1925 1925 ! -(zsumclasses( 7)+zsumclasses( 8)), -zsumclasses( 8),-zsumclasses( 7), & 1926 1926 ! -(zsumclasses( 9)+zsumclasses(10)), -zsumclasses(10),-zsumclasses( 9) 1927 ! CALL FLUSH(numdct_NOOS) 1927 ! CALL FLUSH(numdct_NOOS) 1928 1928 ! endif 1929 1929 1930 ! 1930 ! 1931 1931 ! IF ( ln_dct_iom_cont ) THEN 1932 ! 1932 ! 1933 1933 ! noos_iom_dummy(:,:,:) = 0. 1934 ! 1934 ! 1935 1935 ! tmp_iom_output(:) = 0. 1936 1936 ! tmp_iom_output(1) = -(zsumclasses( 1)+zsumclasses( 2)) 1937 1937 ! tmp_iom_output(2) = -zsumclasses( 2) 1938 1938 ! tmp_iom_output(3) = -zsumclasses( 1) 1939 ! 1940 ! ! Convert to Sv 1939 ! 1940 ! ! Convert to Sv 1941 1941 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 1942 1942 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 1943 1943 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 1944 ! 1944 ! 1945 1945 ! ! limit maximum and minimum values in iom_put 1946 1946 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 1950 1950 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 1951 1951 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 1952 ! 1953 ! ! Set NaN's to Zero 1952 ! 1953 ! ! Set NaN's to Zero 1954 1954 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 1955 1955 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 1956 1956 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 1957 ! 1957 ! 1958 1958 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 1959 1959 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 1960 1960 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 1961 ! 1961 ! 1962 1962 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_trans' 1963 1963 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 1964 1964 ! CALL iom_put( noos_var_sect_name, noos_iom_dummy ) 1965 ! noos_iom_dummy(:,:,:) = 0. 1965 ! noos_iom_dummy(:,:,:) = 0. 1966 1966 ! tmp_iom_output(:) = 0. 1967 1967 ! tmp_iom_output(1) = -(zsumclasses( 7)+zsumclasses( 8)) 1968 1968 ! tmp_iom_output(2) = -zsumclasses( 8) 1969 1969 ! tmp_iom_output(3) = -zsumclasses( 7) 1970 ! 1970 ! 1971 1971 ! ! Convert to TJ/s 1972 1972 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-12 1973 1973 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-12 1974 1974 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-12 1975 ! 1975 ! 1976 1976 ! ! limit maximum and minimum values in iom_put 1977 1977 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 1981 1981 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 1982 1982 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 1983 ! 1984 ! ! Set NaN's to Zero 1983 ! 1984 ! ! Set NaN's to Zero 1985 1985 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 1986 1986 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 1987 1987 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 1988 ! 1988 ! 1989 1989 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 1990 1990 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 1991 1991 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 1992 ! 1992 ! 1993 1993 ! !noos_iom_dummy(:,:,1) = -(zsumclasses( 7)+zsumclasses( 8)) 1994 1994 ! !noos_iom_dummy(:,:,2) = -zsumclasses( 8) 1995 1995 ! !noos_iom_dummy(:,:,3) = -zsumclasses( 7) 1996 ! 1996 ! 1997 1997 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_heat' 1998 1998 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 1999 1999 ! CALL iom_put( noos_var_sect_name, noos_iom_dummy ) 2000 ! 2001 ! noos_iom_dummy(:,:,:) = 0. 2002 ! tmp_iom_output(:) = 0. 2000 ! 2001 ! noos_iom_dummy(:,:,:) = 0. 2002 ! tmp_iom_output(:) = 0. 2003 2003 ! tmp_iom_output(1) = -(zsumclasses( 9)+zsumclasses( 10)) 2004 2004 ! tmp_iom_output(2) = -zsumclasses( 10) 2005 2005 ! tmp_iom_output(3) = -zsumclasses( 9) 2006 ! 2006 ! 2007 2007 ! ! Convert to MT/s 2008 2008 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 2009 2009 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 2010 2010 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 2011 ! 2011 ! 2012 2012 ! ! limit maximum and minimum values in iom_put 2013 2013 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2017 2017 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2018 2018 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2019 ! 2020 ! ! Set NaN's to Zero 2019 ! 2020 ! ! Set NaN's to Zero 2021 2021 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2022 2022 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2023 2023 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2024 ! 2024 ! 2025 2025 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2026 2026 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2027 2027 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2028 ! 2028 ! 2029 2029 ! !noos_iom_dummy(:,:,1) = -(zsumclasses( 9)+zsumclasses( 10)) 2030 2030 ! !noos_iom_dummy(:,:,2) = -zsumclasses( 10) 2031 2031 ! !noos_iom_dummy(:,:,3) = -zsumclasses( 9) 2032 ! 2032 ! 2033 2033 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_salt' 2034 2034 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 2035 2035 ! CALL iom_put( noos_var_sect_name, noos_iom_dummy ) 2036 ! noos_iom_dummy(:,:,:) = 0. 2037 ! tmp_iom_output(:) = 0. 2036 ! noos_iom_dummy(:,:,:) = 0. 2037 ! tmp_iom_output(:) = 0. 2038 2038 ! ENDIF 2039 2039 ! ELSE … … 2042 2042 ! zsumclasses( 7)+zsumclasses( 8) , zsumclasses( 7), zsumclasses( 8), & 2043 2043 ! zsumclasses( 9)+zsumclasses(10) , zsumclasses( 9), zsumclasses(10) 2044 ! CALL FLUSH(numdct_NOOS) 2044 ! CALL FLUSH(numdct_NOOS) 2045 2045 ! endif 2046 ! 2047 ! 2046 ! 2047 ! 2048 2048 ! IF ( ln_dct_iom_cont ) THEN 2049 ! 2049 ! 2050 2050 ! noos_iom_dummy(:,:,:) = 0. 2051 2051 ! tmp_iom_output(:) = 0. 2052 ! 2052 ! 2053 2053 ! tmp_iom_output(1) = (zsumclasses( 1)+zsumclasses( 2)) 2054 2054 ! tmp_iom_output(2) = zsumclasses( 1) 2055 2055 ! tmp_iom_output(3) = zsumclasses( 2) 2056 ! 2056 ! 2057 2057 ! ! Convert to Sv 2058 2058 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 2059 2059 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 2060 2060 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 2061 ! 2061 ! 2062 2062 ! ! limit maximum and minimum values in iom_put 2063 2063 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2067 2067 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2068 2068 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2069 ! 2070 ! ! Set NaN's to Zero 2069 ! 2070 ! ! Set NaN's to Zero 2071 2071 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2072 2072 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2073 2073 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2074 ! 2074 ! 2075 2075 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2076 2076 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2077 2077 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2078 ! 2078 ! 2079 2079 ! !noos_iom_dummy(:,:,1) = (zsumclasses( 1)+zsumclasses( 2)) 2080 2080 ! !noos_iom_dummy(:,:,2) = zsumclasses( 1) 2081 2081 ! !noos_iom_dummy(:,:,3) = zsumclasses( 2) 2082 ! 2083 ! 2084 ! 2082 ! 2083 ! 2084 ! 2085 2085 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_trans' 2086 2086 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name … … 2088 2088 ! noos_iom_dummy(:,:,:) = 0. 2089 2089 ! tmp_iom_output(:) = 0. 2090 ! 2090 ! 2091 2091 ! tmp_iom_output(1) = (zsumclasses( 7)+zsumclasses( 8)) 2092 2092 ! tmp_iom_output(2) = zsumclasses( 7) 2093 2093 ! tmp_iom_output(3) = zsumclasses( 8) 2094 ! 2094 ! 2095 2095 ! ! Convert to TJ/s 2096 2096 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-12 2097 2097 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-12 2098 2098 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-12 2099 ! 2099 ! 2100 2100 ! ! limit maximum and minimum values in iom_put 2101 2101 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2105 2105 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2106 2106 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2107 ! 2108 ! ! Set NaN's to Zero 2107 ! 2108 ! ! Set NaN's to Zero 2109 2109 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2110 2110 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2111 2111 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2112 ! 2112 ! 2113 2113 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2114 2114 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2115 2115 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2116 ! 2116 ! 2117 2117 ! !noos_iom_dummy(:,:,1) = (zsumclasses( 7)+zsumclasses( 8)) 2118 2118 ! !noos_iom_dummy(:,:,2) = zsumclasses( 7) 2119 2119 ! !noos_iom_dummy(:,:,3) = zsumclasses( 8) 2120 ! 2120 ! 2121 2121 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_heat' 2122 2122 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 2123 ! CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2123 ! CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2124 2124 ! noos_iom_dummy(:,:,:) = 0. 2125 2125 ! tmp_iom_output(:) = 0. 2126 ! 2126 ! 2127 2127 ! tmp_iom_output(1) = (zsumclasses( 9)+zsumclasses( 10)) 2128 2128 ! tmp_iom_output(2) = zsumclasses( 9) 2129 2129 ! tmp_iom_output(3) = zsumclasses( 10) 2130 ! 2130 ! 2131 2131 ! ! Convert to MT/s 2132 2132 ! tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 2133 2133 ! tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 2134 2134 ! tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 2135 ! 2136 ! 2135 ! 2136 ! 2137 2137 ! ! limit maximum and minimum values in iom_put 2138 2138 ! if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2142 2142 ! if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2143 2143 ! if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2144 ! 2145 ! ! Set NaN's to Zero 2144 ! 2145 ! ! Set NaN's to Zero 2146 2146 ! if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2147 2147 ! if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2148 2148 ! if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2149 ! 2149 ! 2150 2150 ! noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2151 2151 ! noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2152 2152 ! noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2153 ! 2153 ! 2154 2154 ! !noos_iom_dummy(:,:,1) = (zsumclasses( 9)+zsumclasses( 10)) 2155 2155 ! !noos_iom_dummy(:,:,2) = zsumclasses( 9) 2156 2156 ! !noos_iom_dummy(:,:,3) = zsumclasses( 10) 2157 ! 2157 ! 2158 2158 ! noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_salt' 2159 2159 ! if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 2160 2160 ! CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2161 ! noos_iom_dummy(:,:,:) = 0. 2161 ! noos_iom_dummy(:,:,:) = 0. 2162 2162 ! tmp_iom_output(:) = 0. 2163 2163 ! ENDIF 2164 ! 2165 ! ENDIF 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2164 ! 2165 ! ENDIF 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2176 IF( lwp ) THEN 2177 2177 IF ( ln_dct_ascii ) THEN … … 2185 2185 zsumclasses( 7)+zsumclasses( 8) , zsumclasses( 7), zsumclasses( 8), & 2186 2186 zsumclasses( 9)+zsumclasses(10) , zsumclasses( 9), zsumclasses(10) 2187 CALL FLUSH(numdct_NOOS) 2187 CALL FLUSH(numdct_NOOS) 2188 2188 ENDIF 2189 2189 ENDIF 2190 2190 2191 2191 IF ( ln_dct_iom_cont ) THEN 2192 2192 2193 2193 noos_iom_dummy(:,:,:) = 0. 2194 2194 tmp_iom_output(:) = 0. 2195 2195 2196 2196 tmp_iom_output(1) = (zsumclasses( 1)+zsumclasses( 2)) 2197 2197 tmp_iom_output(2) = zsumclasses( 1) 2198 2198 tmp_iom_output(3) = zsumclasses( 2) 2199 2199 2200 2200 ! Convert to Sv 2201 2201 tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 2202 2202 tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 2203 2203 tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 2204 2204 2205 2205 ! limit maximum and minimum values in iom_put 2206 2206 if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2210 2210 if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2211 2211 if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2212 2213 ! Set NaN's to Zero 2212 2213 ! Set NaN's to Zero 2214 2214 if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2215 2215 if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2216 2216 if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2217 2217 2218 2218 noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2219 2219 noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2220 2220 noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2221 2221 2222 2222 !noos_iom_dummy(:,:,1) = (zsumclasses( 1)+zsumclasses( 2)) 2223 2223 !noos_iom_dummy(:,:,2) = zsumclasses( 1) 2224 2224 !noos_iom_dummy(:,:,3) = zsumclasses( 2) 2225 2226 2227 2225 2226 2227 2228 2228 noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_trans' 2229 2229 if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name … … 2231 2231 noos_iom_dummy(:,:,:) = 0. 2232 2232 tmp_iom_output(:) = 0. 2233 2233 2234 2234 tmp_iom_output(1) = (zsumclasses( 7)+zsumclasses( 8)) 2235 2235 tmp_iom_output(2) = zsumclasses( 7) 2236 2236 tmp_iom_output(3) = zsumclasses( 8) 2237 2237 2238 2238 ! Convert to TJ/s 2239 2239 tmp_iom_output(1) = tmp_iom_output(1)*1.E-12 2240 2240 tmp_iom_output(2) = tmp_iom_output(2)*1.E-12 2241 2241 tmp_iom_output(3) = tmp_iom_output(3)*1.E-12 2242 2242 2243 2243 ! limit maximum and minimum values in iom_put 2244 2244 if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2248 2248 if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2249 2249 if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2250 2251 ! Set NaN's to Zero 2250 2251 ! Set NaN's to Zero 2252 2252 if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2253 2253 if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2254 2254 if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2255 2255 2256 2256 noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2257 2257 noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2258 2258 noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2259 2259 2260 2260 !noos_iom_dummy(:,:,1) = (zsumclasses( 7)+zsumclasses( 8)) 2261 2261 !noos_iom_dummy(:,:,2) = zsumclasses( 7) 2262 2262 !noos_iom_dummy(:,:,3) = zsumclasses( 8) 2263 2263 2264 2264 noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_heat' 2265 2265 if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 2266 CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2266 CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2267 2267 noos_iom_dummy(:,:,:) = 0. 2268 2268 tmp_iom_output(:) = 0. 2269 2269 2270 2270 tmp_iom_output(1) = (zsumclasses( 9)+zsumclasses( 10)) 2271 2271 tmp_iom_output(2) = zsumclasses( 9) 2272 2272 tmp_iom_output(3) = zsumclasses( 10) 2273 2273 2274 2274 ! Convert to MT/s 2275 2275 tmp_iom_output(1) = tmp_iom_output(1)*1.E-6 2276 2276 tmp_iom_output(2) = tmp_iom_output(2)*1.E-6 2277 2277 tmp_iom_output(3) = tmp_iom_output(3)*1.E-6 2278 2279 2278 2279 2280 2280 ! limit maximum and minimum values in iom_put 2281 2281 if ( tmp_iom_output(1) .gt. max_iom_val ) tmp_iom_output(1) = max_iom_val … … 2285 2285 if ( tmp_iom_output(3) .gt. max_iom_val ) tmp_iom_output(3) = max_iom_val 2286 2286 if ( tmp_iom_output(3) .lt. -max_iom_val ) tmp_iom_output(3) = -max_iom_val 2287 2288 ! Set NaN's to Zero 2287 2288 ! Set NaN's to Zero 2289 2289 if ( tmp_iom_output(1) .ne. tmp_iom_output(1) ) tmp_iom_output(1) = max_iom_val*2 2290 2290 if ( tmp_iom_output(2) .ne. tmp_iom_output(2) ) tmp_iom_output(1) = max_iom_val*2 2291 2291 if ( tmp_iom_output(3) .ne. tmp_iom_output(3) ) tmp_iom_output(1) = max_iom_val*2 2292 2292 2293 2293 noos_iom_dummy(:,:,1) = tmp_iom_output(1) 2294 2294 noos_iom_dummy(:,:,2) = tmp_iom_output(2) 2295 2295 noos_iom_dummy(:,:,3) = tmp_iom_output(3) 2296 2296 2297 2297 !noos_iom_dummy(:,:,1) = (zsumclasses( 9)+zsumclasses( 10)) 2298 2298 !noos_iom_dummy(:,:,2) = zsumclasses( 9) 2299 2299 !noos_iom_dummy(:,:,3) = zsumclasses( 10) 2300 2300 2301 2301 noos_var_sect_name = "noos_" // trim(noos_sect_name) // '_salt' 2302 2302 if ( lwp ) WRITE(numout,*) 'dia_dct_wri_NOOS iom_put: ', kt,ksec, noos_var_sect_name 2303 2303 CALL iom_put(noos_var_sect_name, noos_iom_dummy ) 2304 noos_iom_dummy(:,:,:) = 0. 2304 noos_iom_dummy(:,:,:) = 0. 2305 2305 tmp_iom_output(:) = 0. 2306 2306 … … 2308 2308 DEALLOCATE(noos_iom_dummy) 2309 2309 ENDIF 2310 2310 2311 2311 2312 2312 DO jclass=1,MAX(1,sec%nb_class-1) 2313 2313 2314 2314 classe = 'N ' 2315 2315 zbnd1 = 0._wp … … 2332 2332 !depth classes transports 2333 2333 IF( ( sec%zlay(jclass) .NE. 99._wp ) .AND. & 2334 ( sec%zlay(jclass+1) .NE. 99._wp ) )THEN 2334 ( sec%zlay(jclass+1) .NE. 99._wp ) )THEN 2335 2335 classe = 'Z ' 2336 2336 zbnd1 = sec%zlay(jclass) … … 2342 2342 classe = 'S ' 2343 2343 zbnd1 = sec%zsal(jclass) 2344 zbnd2 = sec%zsal(jclass+1) 2344 zbnd2 = sec%zsal(jclass+1) 2345 2345 ENDIF 2346 2346 !temperature classes transports … … 2351 2351 zbnd2 = sec%ztem(jclass+1) 2352 2352 ENDIF 2353 2353 2354 2354 !write volume transport per class 2355 2355 IF( lwp ) THEN 2356 2356 2357 2357 IF ( ln_dct_ascii ) THEN 2358 2358 CALL FLUSH(numdct_NOOS) ! JT crash … … 2387 2387 2388 2388 ENDDO 2389 2389 2390 2390 !IF ( ln_dct_ascii ) THEN 2391 2391 if ( lwp ) CALL FLUSH(numdct_NOOS) 2392 2392 !ENDIF 2393 2393 2394 CALL wrk_dealloc(nb_type , zsumclasses ) 2394 CALL wrk_dealloc(nb_type , zsumclasses ) 2395 2395 2396 2396 END SUBROUTINE dia_dct_wri_NOOS … … 2400 2400 !! As routine dia_dct_wri_NOOS but for hourly output files 2401 2401 !! 2402 !! Write transport output in numdct using NOOS formatting 2403 !! 2402 !! Write transport output in numdct using NOOS formatting 2403 !! 2404 2404 !! Purpose: Write transports in ascii files 2405 !! 2405 !! 2406 2406 !! Method: 2407 2407 !! 1. Write volume transports in "volume_transport" 2408 !! Unit: Sv : area * Velocity / 1.e6 2409 !! 2410 !!------------------------------------------------------------- 2408 !! Unit: Sv : area * Velocity / 1.e6 2409 !! 2410 !!------------------------------------------------------------- 2411 2411 !!arguments 2412 2412 INTEGER, INTENT(IN) :: hr ! hour => effectively kt/12 2413 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 2413 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 2414 2414 INTEGER ,INTENT(IN) :: ksec ! section number 2415 2415 2416 2416 !!local declarations 2417 2417 INTEGER :: jclass,jhr ! Dummy loop 2418 CHARACTER(len=2) :: classe ! Classname 2418 CHARACTER(len=2) :: classe ! Classname 2419 2419 REAL(wp) :: zbnd1,zbnd2 ! Class bounds 2420 2420 REAL(wp) :: zslope ! section's slope coeff 2421 2421 ! 2422 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 2423 CHARACTER(len=3) :: noos_sect_name ! Classname 2422 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 2423 CHARACTER(len=3) :: noos_sect_name ! Classname 2424 2424 CHARACTER(len=25) :: noos_var_sect_name 2425 2425 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: noos_iom_dummy 2426 2426 INTEGER :: IERR 2427 2428 !!------------------------------------------------------------- 2427 2428 !!------------------------------------------------------------- 2429 2429 2430 2430 IF( lwp ) THEN … … 2432 2432 WRITE(numout,*) "dia_dct_wri_NOOS_h: write transports through section Transect:",ksec-1," at timestep: ", hr 2433 2433 WRITE(numout,*) "~~~~~~~~~~~~~~~~~~~~~" 2434 ENDIF 2435 2436 CALL wrk_alloc(nb_type , zsumclasses ) 2437 2438 2434 ENDIF 2435 2436 CALL wrk_alloc(nb_type , zsumclasses ) 2437 2438 2439 2439 write (noos_sect_name, "(I03)") ksec 2440 2440 2441 2441 ALLOCATE( noos_iom_dummy(jpi,jpj,3), STAT= ierr ) 2442 2442 IF( ierr /= 0 ) CALL ctl_stop( 'dia_dct_wri_NOOS_h: failed to allocate noos_iom_dummy array' ) … … 2444 2444 2445 2445 2446 2446 2447 2447 2448 2448 zsumclasses(:)=0._wp 2449 zslope = sec%slopeSection 2449 zslope = sec%slopeSection 2450 2450 2451 2451 ! Sum up all classes, to give the total per type (pos vol trans, neg vol trans etc...) … … 2453 2453 zsumclasses(1:nb_type)=zsumclasses(1:nb_type)+sec%transport_h(1:nb_type,jclass) 2454 2454 ENDDO 2455 2456 2455 2456 2457 2457 ! JT 2458 2458 ! JT … … 2485 2485 ! JT ENDIF 2486 2486 ! JT ENDDO 2487 2487 2488 2488 !write volume transport per class 2489 2489 ! Sum positive and vol trans for all classes in first cell of array … … 2500 2500 ENDDO 2501 2501 2502 2502 2503 2503 IF( lwp ) THEN 2504 2504 ! JT IF ( hr .eq. 48._wp ) THEN … … 2526 2526 2527 2527 2528 ENDIF 2528 ENDIF 2529 2529 2530 2530 2531 2531 CALL wrk_dealloc(nb_type , zsumclasses ) 2532 2532 2533 2533 DEALLOCATE(noos_iom_dummy) 2534 2534 … … 2539 2539 SUBROUTINE dia_dct_wri(kt,ksec,sec) 2540 2540 !!------------------------------------------------------------- 2541 !! Write transport output in numdct 2542 !! 2541 !! Write transport output in numdct 2542 !! 2543 2543 !! Purpose: Write transports in ascii files 2544 !! 2544 !! 2545 2545 !! Method: 2546 2546 !! 1. Write volume transports in "volume_transport" 2547 !! Unit: Sv : area * Velocity / 1.e6 2548 !! 2547 !! Unit: Sv : area * Velocity / 1.e6 2548 !! 2549 2549 !! 2. Write heat transports in "heat_transport" 2550 2550 !! Unit: Peta W : area * Velocity * T * rhau * Cp / 1.e15 2551 !! 2551 !! 2552 2552 !! 3. Write salt transports in "salt_transport" 2553 2553 !! Unit: 10^9 g m^3 / s : area * Velocity * S / 1.e6 2554 2554 !! 2555 !!------------------------------------------------------------- 2555 !!------------------------------------------------------------- 2556 2556 !!arguments 2557 2557 INTEGER, INTENT(IN) :: kt ! time-step 2558 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 2558 TYPE(SECTION), INTENT(INOUT) :: sec ! section to write 2559 2559 INTEGER ,INTENT(IN) :: ksec ! section number 2560 2560 2561 2561 !!local declarations 2562 2562 INTEGER :: jclass ! Dummy loop 2563 CHARACTER(len=2) :: classe ! Classname 2563 CHARACTER(len=2) :: classe ! Classname 2564 2564 REAL(wp) :: zbnd1,zbnd2 ! Class bounds 2565 2565 REAL(wp) :: zslope ! section's slope coeff 2566 2566 ! 2567 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 2568 !!------------------------------------------------------------- 2569 CALL wrk_alloc(nb_type , zsumclasses ) 2567 REAL(wp), POINTER, DIMENSION(:):: zsumclasses ! 1D workspace 2568 !!------------------------------------------------------------- 2569 CALL wrk_alloc(nb_type , zsumclasses ) 2570 2570 2571 2571 zsumclasses(:)=0._wp 2572 zslope = sec%slopeSection 2573 2574 2572 zslope = sec%slopeSection 2573 2574 2575 2575 DO jclass=1,MAX(1,sec%nb_class-1) 2576 2576 … … 2580 2580 zsumclasses(1:nb_type)=zsumclasses(1:nb_type)+sec%transport(1:nb_type,jclass) 2581 2581 2582 2582 2583 2583 !insitu density classes transports 2584 2584 IF( ( sec%zsigi(jclass) .NE. 99._wp ) .AND. & … … 2597 2597 !depth classes transports 2598 2598 IF( ( sec%zlay(jclass) .NE. 99._wp ) .AND. & 2599 ( sec%zlay(jclass+1) .NE. 99._wp ) )THEN 2599 ( sec%zlay(jclass+1) .NE. 99._wp ) )THEN 2600 2600 classe = 'Z ' 2601 2601 zbnd1 = sec%zlay(jclass) … … 2607 2607 classe = 'S ' 2608 2608 zbnd1 = sec%zsal(jclass) 2609 zbnd2 = sec%zsal(jclass+1) 2609 zbnd2 = sec%zsal(jclass+1) 2610 2610 ENDIF 2611 2611 !temperature classes transports … … 2616 2616 zbnd2 = sec%ztem(jclass+1) 2617 2617 ENDIF 2618 2618 2619 2619 !write volume transport per class 2620 2620 WRITE(numdct_vol,118) ndastp,kt,ksec,sec%name,zslope, & … … 2662 2662 ENDIF 2663 2663 2664 2664 2665 2665 IF ( sec%ll_ice_section) THEN 2666 2666 !write total ice volume transport … … 2673 2673 jclass,"ice_surf",zbnd1,zbnd2,& 2674 2674 sec%transport(13,1),sec%transport(14,1), & 2675 sec%transport(13,1)+sec%transport(14,1) 2675 sec%transport(13,1)+sec%transport(14,1) 2676 2676 ENDIF 2677 2677 2678 2678 118 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3F12.4) 2679 2679 119 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6) 2680 2680 2681 CALL wrk_dealloc(nb_type , zsumclasses ) 2681 CALL wrk_dealloc(nb_type , zsumclasses ) 2682 2682 END SUBROUTINE dia_dct_wri 2683 2683 … … 2692 2692 !! 2693 2693 !! ====> full step and partial step 2694 !! 2694 !! 2695 2695 !! 2696 2696 !! | I | I+1 | Z=Temperature/Salinity/density at U-poinT … … 2698 2698 !! ---------------------------------------- 1. Veritcale interpolation: compute zbis 2699 2699 !! | | | interpolation between ptab(I,J,K) and ptab(I,J,K+1) 2700 !! | | | zbis = 2700 !! | | | zbis = 2701 2701 !! | | | [ e3w(I+1,J,K)*ptab(I,J,K) + ( e3w(I,J,K) - e3w(I+1,J,K) ) * ptab(I,J,K-1) ] 2702 !! | | | /[ e3w(I+1,J,K) + e3w(I,J,K) - e3w(I+1,J,K) ] 2703 !! | | | 2702 !! | | | /[ e3w(I+1,J,K) + e3w(I,J,K) - e3w(I+1,J,K) ] 2703 !! | | | 2704 2704 !! | | | 2. Horizontal interpolation: compute value at U/V point 2705 !!K-1 | ptab(I,J,K-1) | | interpolation between zbis and ptab(I+1,J,K) 2705 !!K-1 | ptab(I,J,K-1) | | interpolation between zbis and ptab(I+1,J,K) 2706 2706 !! | . | | 2707 !! | . | | interp = ( 0.5*zet2*zbis + 0.5*zet1*ptab(I+1,J,K) )/(0.5*zet2+0.5*zet1) 2707 !! | . | | interp = ( 0.5*zet2*zbis + 0.5*zet1*ptab(I+1,J,K) )/(0.5*zet2+0.5*zet1) 2708 2708 !! | . | | 2709 2709 !! ------------------------------------------ … … 2722 2722 !! 2723 2723 !! ====> s-coordinate 2724 !! 2724 !! 2725 2725 !! | | | 1. Compute distance between T1 and U points: SQRT( zdep1^2 + (0.5 * zet1 )^2 2726 2726 !! | | | Compute distance between T2 and U points: SQRT( zdep2^2 + (0.5 * zet2 )^2 2727 !! | | ptab(I+1,J,K) | 2728 !! | | T2 | 2. Interpolation between T1 and T2 values at U point 2729 !! | | ^ | 2730 !! | | | zdep2 | 2731 !! | | | | 2727 !! | | ptab(I+1,J,K) | 2728 !! | | T2 | 2. Interpolation between T1 and T2 values at U point 2729 !! | | ^ | 2730 !! | | | zdep2 | 2731 !! | | | | 2732 2732 !! | ^ U v | 2733 2733 !! | | | | 2734 !! | | zdep1 | | 2734 !! | | zdep1 | | 2735 2735 !! | v | | 2736 2736 !! | T1 | | 2737 !! | ptab(I,J,K) | | 2738 !! | | | 2739 !! | | | 2737 !! | ptab(I,J,K) | | 2738 !! | | | 2739 !! | | | 2740 2740 !! 2741 2741 !! <----zet1--------><----zet2---------> … … 2746 2746 CHARACTER(len=1), INTENT(IN) :: cd_point ! type of point (U, V) 2747 2747 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(IN) :: ptab ! variable to compute at (ki, kj, kk ) 2748 REAL(wp) :: interp ! interpolated variable 2748 REAL(wp) :: interp ! interpolated variable 2749 2749 2750 2750 !*local declations 2751 2751 INTEGER :: ii1, ij1, ii2, ij2 ! local integer 2752 2752 REAL(wp):: ze3t, zfse3, zwgt1, zwgt2, zbis, zdepu ! local real 2753 REAL(wp):: zet1, zet2 ! weight for interpolation 2753 REAL(wp):: zet1, zet2 ! weight for interpolation 2754 2754 REAL(wp):: zdep1,zdep2 ! differences of depth 2755 2755 !!---------------------------------------------------------------------- 2756 2756 2757 IF( cd_point=='U' )THEN 2758 ii1 = ki ; ij1 = kj 2759 ii2 = ki+1 ; ij2 = kj 2757 IF( cd_point=='U' )THEN 2758 ii1 = ki ; ij1 = kj 2759 ii2 = ki+1 ; ij2 = kj 2760 2760 2761 2761 zet1=e1t(ii1,ij1) 2762 2762 zet2=e1t(ii2,ij2) 2763 2764 2765 ELSE ! cd_point=='V' 2766 ii1 = ki ; ij1 = kj 2767 ii2 = ki ; ij2 = kj+1 2763 2764 2765 ELSE ! cd_point=='V' 2766 ii1 = ki ; ij1 = kj 2767 ii2 = ki ; ij2 = kj+1 2768 2768 2769 2769 zet1=e2t(ii1,ij1) … … 2774 2774 IF( ln_sco )THEN ! s-coordinate case 2775 2775 2776 zdepu = ( fsdept(ii1,ij1,kk) + fsdept(ii2,ij2,kk) ) /2 2776 zdepu = ( fsdept(ii1,ij1,kk) + fsdept(ii2,ij2,kk) ) /2 2777 2777 zdep1 = fsdept(ii1,ij1,kk) - zdepu 2778 2778 zdep2 = fsdept(ii2,ij2,kk) - zdepu … … 2781 2781 zwgt1 = SQRT( ( 0.5 * zet1 ) * ( 0.5 * zet1 ) + ( zdep1 * zdep1 ) ) 2782 2782 zwgt2 = SQRT( ( 0.5 * zet2 ) * ( 0.5 * zet2 ) + ( zdep2 * zdep2 ) ) 2783 2783 2784 2784 ! result 2785 interp = umask(ii1,ij1,kk) * ( zwgt2 * ptab(ii1,ij1,kk) + zwgt1 * ptab(ii1,ij1,kk) ) / ( zwgt2 + zwgt1 ) 2786 2787 2788 ELSE ! full step or partial step case 2785 interp = umask(ii1,ij1,kk) * ( zwgt2 * ptab(ii1,ij1,kk) + zwgt1 * ptab(ii1,ij1,kk) ) / ( zwgt2 + zwgt1 ) 2786 2787 2788 ELSE ! full step or partial step case 2789 2789 2790 2790 #if defined key_vvl 2791 2791 2792 ze3t = fse3t_n(ii2,ij2,kk) - fse3t_n(ii1,ij1,kk) 2792 ze3t = fse3t_n(ii2,ij2,kk) - fse3t_n(ii1,ij1,kk) 2793 2793 zwgt1 = ( fse3w_n(ii2,ij2,kk) - fse3w_n(ii1,ij1,kk) ) / fse3w_n(ii2,ij2,kk) 2794 2794 zwgt2 = ( fse3w_n(ii1,ij1,kk) - fse3w_n(ii2,ij2,kk) ) / fse3w_n(ii1,ij1,kk) … … 2796 2796 #else 2797 2797 2798 ze3t = fse3t(ii2,ij2,kk) - fse3t(ii1,ij1,kk) 2798 ze3t = fse3t(ii2,ij2,kk) - fse3t(ii1,ij1,kk) 2799 2799 zwgt1 = ( fse3w(ii2,ij2,kk) - fse3w(ii1,ij1,kk) ) / fse3w(ii2,ij2,kk) 2800 2800 zwgt2 = ( fse3w(ii1,ij1,kk) - fse3w(ii2,ij2,kk) ) / fse3w(ii1,ij1,kk) … … 2804 2804 IF(kk .NE. 1)THEN 2805 2805 2806 IF( ze3t >= 0. )THEN 2806 IF( ze3t >= 0. )THEN 2807 2807 ! zbis 2808 zbis = ptab(ii2,ij2,kk) + zwgt1 * ( ptab(ii2,ij2,kk-1) - ptab(ii2,ij2,kk) ) 2808 zbis = ptab(ii2,ij2,kk) + zwgt1 * ( ptab(ii2,ij2,kk-1) - ptab(ii2,ij2,kk) ) 2809 2809 ! result 2810 2810 interp = umask(ii1,ij1,kk) * ( zet2 * ptab(ii1,ij1,kk) + zet1 * zbis )/( zet1 + zet2 ) … … 2814 2814 ! result 2815 2815 interp = umask(ii1,ij1,kk) * ( zet2 * zbis + zet1 * ptab(ii2,ij2,kk) )/( zet1 + zet2 ) 2816 ENDIF 2816 ENDIF 2817 2817 2818 2818 ELSE … … 2830 2830 !!---------------------------------------------------------------------- 2831 2831 LOGICAL, PUBLIC, PARAMETER :: lk_diadct = .FALSE. !: diamht flag 2832 PUBLIC 2832 PUBLIC 2833 2833 !! $Id$ 2834 2834 CONTAINS -
branches/UKMO/CO6_shelfclimate_fabm_noos/NEMOGCM/NEMO/OPA_SRC/SBC/tide_mod.F90
r7566 r15798 70 70 !!---------------------------------------------------------------------- 71 71 ! 72 zqy = AINT( (nyear-1901.)/4. ) 73 zsy = nyear - 1900. 74 ! 75 zdj = dayjul( nyear, nmonth, nday ) 76 zday = zdj + zqy - 1. 77 ! 78 zhfrac = nsec_day / 3600. 72 zqy = AINT( (nyear-1901.)/4. ) ! leap years since 1901 73 zsy = nyear - 1900. ! years since 1900 74 ! 75 zdj = dayjul( nyear, nmonth, nday ) ! day number of year 76 zday = zdj + zqy - 1. ! day number of year + No of leap yrs 77 ! i.e. what would doy if every year = 365 day?? 78 ! 79 zhfrac = nsec_day / 3600. ! The seconds of the day/3600 79 80 ! 80 81 !---------------------------------------------------------------------- -
branches/UKMO/CO6_shelfclimate_fabm_noos/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
r7566 r15798 178 178 ! 179 179 ! bottom friction (explicit before friction) 180 ! Note that we chose here not to bound the friction as in dynbfr) 180 ! Note that we chose here not to bound the friction as in dynbfr) 181 181 ztx2 = ( bfrua(ji,jj) * ub(ji,jj,mbku(ji,jj)) + bfrua(ji-1,jj) * ub(ji-1,jj,mbku(ji-1,jj)) ) & 182 182 & * ( 1._wp - 0.5_wp * umask(ji,jj,1) * umask(ji-1,jj,1) )
Note: See TracChangeset
for help on using the changeset viewer.