New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 3557 for branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90 – NEMO

Ignore:
Timestamp:
2012-11-14T18:04:49+01:00 (11 years ago)
Author:
cetlod
Message:

branch:2012/dev_r3438_LOCEAN15_PISLOB minor modifications for PISCES when using AGRIF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2012/dev_r3438_LOCEAN15_PISLOB/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90

    r3475 r3557  
    274274         IF( sn_dust%ln_tint )     ALLOCATE( sf_dust(1)%fdta(jpi,jpj,1,2) ) 
    275275         ! 
    276          ! Get total input dust ; need to compute total atmospheric supply of Si in a year 
    277          CALL iom_open (  TRIM( sn_dust%clname ) , numdust ) 
    278          CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust)  ! get number of record in file 
    279          ALLOCATE( zdust(jpi,jpj,ntimes_dust) ) 
    280          DO jm = 1, ntimes_dust 
    281             CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm ) 
    282          END DO 
    283          CALL iom_close( numdust ) 
    284          ztimes_dust = 1._wp / FLOAT( ntimes_dust )  
    285          sumdepsi = 0.e0 
    286          DO jm = 1, ntimes_dust 
    287             sumdepsi = sumdepsi + glob_sum( zdust(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_dust ) 
    288          ENDDO 
    289          sumdepsi = sumdepsi / ( nyear_len(1) * rday ) * 12. * 8.8 * 0.075 / 28.1  
    290          DEALLOCATE( zdust) 
     276         IF( Agrif_Root() ) THEN   !  Only on the master grid 
     277            ! Get total input dust ; need to compute total atmospheric supply of Si in a year 
     278            CALL iom_open (  TRIM( sn_dust%clname ) , numdust ) 
     279            CALL iom_gettime( numdust, zsteps, kntime=ntimes_dust)  ! get number of record in file 
     280            ALLOCATE( zdust(jpi,jpj,ntimes_dust) ) 
     281            DO jm = 1, ntimes_dust 
     282               CALL iom_get( numdust, jpdom_data, TRIM( sn_dust%clvar ), zdust(:,:,jm), jm ) 
     283            END DO 
     284            CALL iom_close( numdust ) 
     285            ztimes_dust = 1._wp / FLOAT( ntimes_dust )  
     286            sumdepsi = 0.e0 
     287            DO jm = 1, ntimes_dust 
     288               sumdepsi = sumdepsi + glob_sum( zdust(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_dust ) 
     289            ENDDO 
     290            sumdepsi = sumdepsi / ( nyear_len(1) * rday ) * 12. * 8.8 * 0.075 / 28.1  
     291            DEALLOCATE( zdust) 
     292         ENDIF 
    291293      ELSE 
    292294         sumdepsi  = 0._wp 
     
    335337            IF( slf_river(ifpr)%ln_tint ) ALLOCATE( sf_river(ifpr)%fdta(jpi,jpj,1,2) ) 
    336338         END DO 
    337          ! Get total input rivers ; need to compute total river supply in a year 
    338          DO ifpr = 1, jpriv 
    339             CALL iom_open ( TRIM( slf_river(ifpr)%clname ), numriv ) 
    340             CALL iom_gettime( numriv, zsteps, kntime=ntimes_riv) 
    341             ALLOCATE( zriver(jpi,jpj,ntimes_riv) ) 
    342             DO jm = 1, ntimes_riv 
    343                CALL iom_get( numriv, jpdom_data, TRIM( slf_river(ifpr)%clvar ), zriver(:,:,jm), jm ) 
    344             END DO 
    345             CALL iom_close( numriv ) 
    346             ztimes_riv = 1._wp / FLOAT(ntimes_riv)  
    347             DO jm = 1, ntimes_riv 
    348                rivinput(ifpr) = rivinput(ifpr) + glob_sum( zriver(:,:,jm) * tmask(:,:,1) * ztimes_riv )  
    349             END DO 
    350             DEALLOCATE( zriver) 
    351          END DO 
    352          ! N/P and Si releases due to coastal rivers 
    353          ! ----------------------------------------- 
    354          rivdicinput = (rivinput(jr_dic) + rivinput(jr_doc) ) * 1E3 / 12._wp 
    355          rivdininput = (rivinput(jr_din) + rivinput(jr_don) ) * 1E3 / rno3 / 14._wp 
    356          rivdipinput = (rivinput(jr_dip) + rivinput(jr_dop) ) * 1E3 / po4r / 31._wp 
    357          rivdsiinput = rivinput(jr_dsi) * 1E3 / 28.1_wp 
    358          rivalkinput = rivinput(jr_dic) * 1E3 / 12._wp 
    359          ! 
     339         IF( Agrif_Root() ) THEN   !  Only on the master grid 
     340            ! Get total input rivers ; need to compute total river supply in a year 
     341            DO ifpr = 1, jpriv 
     342               CALL iom_open ( TRIM( slf_river(ifpr)%clname ), numriv ) 
     343               CALL iom_gettime( numriv, zsteps, kntime=ntimes_riv) 
     344               ALLOCATE( zriver(jpi,jpj,ntimes_riv) ) 
     345               DO jm = 1, ntimes_riv 
     346                  CALL iom_get( numriv, jpdom_data, TRIM( slf_river(ifpr)%clvar ), zriver(:,:,jm), jm ) 
     347               END DO 
     348               CALL iom_close( numriv ) 
     349               ztimes_riv = 1._wp / FLOAT(ntimes_riv)  
     350               DO jm = 1, ntimes_riv 
     351                  rivinput(ifpr) = rivinput(ifpr) + glob_sum( zriver(:,:,jm) * tmask(:,:,1) * ztimes_riv )  
     352               END DO 
     353               DEALLOCATE( zriver) 
     354            END DO 
     355            ! N/P and Si releases due to coastal rivers 
     356            ! ----------------------------------------- 
     357            rivdicinput = (rivinput(jr_dic) + rivinput(jr_doc) ) * 1E3 / 12._wp 
     358            rivdininput = (rivinput(jr_din) + rivinput(jr_don) ) * 1E3 / rno3 / 14._wp 
     359            rivdipinput = (rivinput(jr_dip) + rivinput(jr_dop) ) * 1E3 / po4r / 31._wp 
     360            rivdsiinput = rivinput(jr_dsi) * 1E3 / 28.1_wp 
     361            rivalkinput = rivinput(jr_dic) * 1E3 / 12._wp 
     362            ! 
     363         ENDIF 
    360364      ELSE 
    361365         rivdicinput = 0._wp 
     
    382386         IF( sn_ndepo%ln_tint )    ALLOCATE( sf_ndepo(1)%fdta(jpi,jpj,1,2) ) 
    383387         ! 
    384          ! Get total input dust ; need to compute total atmospheric supply of N in a year 
    385          CALL iom_open ( TRIM( sn_ndepo%clname ), numdepo ) 
    386          CALL iom_gettime( numdepo, zsteps, kntime=ntimes_ndep) 
    387          ALLOCATE( zndepo(jpi,jpj,ntimes_ndep) ) 
    388          DO jm = 1, ntimes_ndep 
    389             CALL iom_get( numdepo, jpdom_data, TRIM( sn_ndepo%clvar ), zndepo(:,:,jm), jm ) 
    390          END DO 
    391          CALL iom_close( numdepo ) 
    392          ztimes_ndep = 1._wp / FLOAT( ntimes_ndep )  
    393          nitdepinput = 0._wp 
    394          DO jm = 1, ntimes_ndep 
    395            nitdepinput = nitdepinput + glob_sum( zndepo(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_ndep ) 
    396          ENDDO 
    397          nitdepinput = nitdepinput / rno3 / 14E6  
    398          DEALLOCATE( zndepo) 
     388         IF( Agrif_Root() ) THEN   !  Only on the master grid 
     389            ! Get total input dust ; need to compute total atmospheric supply of N in a year 
     390            CALL iom_open ( TRIM( sn_ndepo%clname ), numdepo ) 
     391            CALL iom_gettime( numdepo, zsteps, kntime=ntimes_ndep) 
     392            ALLOCATE( zndepo(jpi,jpj,ntimes_ndep) ) 
     393            DO jm = 1, ntimes_ndep 
     394               CALL iom_get( numdepo, jpdom_data, TRIM( sn_ndepo%clvar ), zndepo(:,:,jm), jm ) 
     395            END DO 
     396            CALL iom_close( numdepo ) 
     397            ztimes_ndep = 1._wp / FLOAT( ntimes_ndep )  
     398            nitdepinput = 0._wp 
     399            DO jm = 1, ntimes_ndep 
     400              nitdepinput = nitdepinput + glob_sum( zndepo(:,:,jm) * e1e2t(:,:) * tmask(:,:,1) * ztimes_ndep ) 
     401            ENDDO 
     402            nitdepinput = nitdepinput / rno3 / 14E6  
     403            DEALLOCATE( zndepo) 
     404         ENDIF 
    399405      ELSE 
    400406         nitdepinput = 0._wp 
Note: See TracChangeset for help on using the changeset viewer.