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 13540 for NEMO/branches/2020/r12377_ticket2386/tests/STATION_ASF/MY_SRC/stpctl.F90 – NEMO

Ignore:
Timestamp:
2020-09-29T12:41:06+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2386: update to latest trunk

Location:
NEMO/branches/2020/r12377_ticket2386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/r12377_ticket2386

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
        88 
        99# SETTE 
        10 ^/utils/CI/sette@HEAD         sette 
         10^/utils/CI/sette@13507        sette 
  • NEMO/branches/2020/r12377_ticket2386/tests/STATION_ASF/MY_SRC/stpctl.F90

    r12254 r13540  
    1919   USE dom_oce         ! ocean space and time domain variables 
    2020   USE sbc_oce         ! surface fluxes and stuff 
     21   ! 
    2122   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
    22    ! 
    2323   USE in_out_manager  ! I/O manager 
    2424   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2525   USE lib_mpp         ! distributed memory computing 
    26  
     26   ! 
    2727   USE netcdf          ! NetCDF library 
    2828   IMPLICIT NONE 
     
    3131   PUBLIC stp_ctl           ! routine called by step.F90 
    3232 
    33    INTEGER  ::   idrun, idtime, idtau, idqns, idemp, istatus 
    34    LOGICAL  ::   lsomeoce 
     33   INTEGER                ::   nrunid   ! netcdf file id 
     34   INTEGER, DIMENSION(3)  ::   nvarid   ! netcdf variable id 
    3535   !!---------------------------------------------------------------------- 
    3636   !! NEMO/SAS 4.0 , NEMO Consortium (2018) 
     
    4040CONTAINS 
    4141 
    42    SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 
     42   SUBROUTINE stp_ctl( kt, Kmm ) 
    4343      !!---------------------------------------------------------------------- 
    4444      !!                    ***  ROUTINE stp_ctl  *** 
    45       !! 
     45      !!                      
    4646      !! ** Purpose :   Control the run 
    4747      !! 
    4848      !! ** Method  : - Save the time step in numstp 
    49       !!              - Print it each 50 time steps 
    50       !!              - Stop the run IF problem encountered by setting indic=-3 
     49      !!              - Stop the run IF problem encountered by setting nstop > 0 
     50      !!                Problems checked: wind stress module  max larger than 5 N/m^2 
     51      !!                                  non-solar heat flux max larger than 2000 W/m^2 
     52      !!                                  Evaporation-Precip  max larger than 1.E-3 kg/m^2/s 
    5153      !! 
    5254      !! ** Actions :   "time.step" file = last ocean time-step 
    5355      !!                "run.stat"  file = run statistics 
    54       !!                nstop indicator sheared among all local domain (lk_mpp=T) 
     56      !!                 nstop indicator sheared among all local domain 
    5557      !!---------------------------------------------------------------------- 
    5658      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
    57       INTEGER, INTENT(in   ) ::   Kbb, Kmm      ! ocean time level index 
    58       INTEGER, INTENT(inout) ::   kindic   ! error indicator 
    59       !! 
    60       REAL(wp), DIMENSION(3) ::   zmax 
    61       LOGICAL                ::   ll_wrtstp, ll_colruns, ll_wrtruns 
    62       CHARACTER(len=20) :: clname 
    63       !!---------------------------------------------------------------------- 
    64       ! 
    65       ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
    66       ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 
    67       ll_wrtruns = ll_colruns .AND. lwm 
    68       IF( kt == nit000 .AND. lwp ) THEN 
    69          WRITE(numout,*) 
    70          WRITE(numout,*) 'stp_ctl : time-stepping control' 
    71          WRITE(numout,*) '~~~~~~~' 
    72          !                                ! open time.step file 
    73          IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    74          !                                ! open run.stat file(s) at start whatever 
    75          !                                ! the value of sn_cfctl%ptimincr 
    76          IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 
     59      INTEGER, INTENT(in   ) ::   Kmm      ! ocean time level index 
     60      !! 
     61      INTEGER                         ::   ji                                    ! dummy loop indices 
     62      INTEGER                         ::   idtime, istatus 
     63      INTEGER , DIMENSION(4)          ::   iareasum, iareamin, iareamax 
     64      INTEGER , DIMENSION(3,3)        ::   iloc                                  ! min/max loc indices 
     65      REAL(wp)                        ::   zzz                                   ! local real  
     66      REAL(wp), DIMENSION(4)          ::   zmax, zmaxlocal 
     67      LOGICAL                         ::   ll_wrtstp, ll_colruns, ll_wrtruns 
     68      LOGICAL, DIMENSION(jpi,jpj)     ::   llmsk 
     69      CHARACTER(len=20)               ::   clname 
     70      !!---------------------------------------------------------------------- 
     71      IF( nstop > 0 .AND. ngrdstop > -1 )   RETURN   !   stpctl was already called by a child grid 
     72      ! 
     73      ll_wrtstp  = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
     74      ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1  
     75      ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm 
     76      ! 
     77      IF( kt == nit000 ) THEN 
     78         ! 
     79         IF( lwp ) THEN 
     80            WRITE(numout,*) 
     81            WRITE(numout,*) 'stp_ctl : time-stepping control' 
     82            WRITE(numout,*) '~~~~~~~' 
     83         ENDIF 
     84         !                                ! open time.step    ascii file, done only by 1st subdomain 
     85         IF( lwm )   CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     86         ! 
     87         IF( ll_wrtruns ) THEN 
     88            !                             ! open run.stat     ascii file, done only by 1st subdomain 
    7789            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     90            !                             ! open run.stat.nc netcdf file, done only by 1st subdomain 
    7891            clname = 'run.stat.nc' 
    7992            IF( .NOT. Agrif_Root() )   clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 
    80             istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, idrun ) 
    81             istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 
    82             istatus = NF90_DEF_VAR( idrun, 'tau_max', NF90_DOUBLE, (/ idtime /), idtau ) 
    83             istatus = NF90_DEF_VAR( idrun, 'qns_max', NF90_DOUBLE, (/ idtime /), idqns   ) 
    84             istatus = NF90_DEF_VAR( idrun, 'emp_max', NF90_DOUBLE, (/ idtime /), idemp   ) 
    85             istatus = NF90_ENDDEF(idrun) 
    86          ENDIF 
    87       ENDIF 
    88       IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    89       ! 
    90       IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
     93            istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid ) 
     94            istatus = NF90_DEF_DIM( nrunid, 'time', NF90_UNLIMITED, idtime ) 
     95            istatus = NF90_DEF_VAR( nrunid, 'tau_max', NF90_DOUBLE, (/ idtime /), nvarid(1) ) 
     96            istatus = NF90_DEF_VAR( nrunid, 'qns_max', NF90_DOUBLE, (/ idtime /), nvarid(2) ) 
     97            istatus = NF90_DEF_VAR( nrunid, 'emp_max', NF90_DOUBLE, (/ idtime /), nvarid(3) ) 
     98            istatus = NF90_ENDDEF(nrunid) 
     99         ENDIF 
     100         !     
     101      ENDIF 
     102      ! 
     103      !                                   !==              write current time step              ==! 
     104      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
     105      IF( lwm .AND. ll_wrtstp ) THEN 
    91106         WRITE ( numstp, '(1x, i8)' )   kt 
    92107         REWIND( numstp ) 
    93108      ENDIF 
    94       ! 
    95       !                                   !==  test of extrema  ==! 
    96       zmax(1) = MAXVAL(     taum(:,:)   , mask = tmask(:,:,1) == 1._wp )                                         ! max wind stress module 
    97       zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = tmask(:,:,1) == 1._wp )                                         ! max non-solar heat flux 
    98       zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = tmask(:,:,1) == 1._wp )                                         ! max E-P 
    99       ! 
     109      !                                   !==            test of local extrema           ==! 
     110      !                                   !==  done by all processes at every time step  ==! 
     111      ! 
     112      llmsk(   1:Nis1,:) = .FALSE.                                              ! exclude halos from the checked region 
     113      llmsk(Nie1: jpi,:) = .FALSE. 
     114      llmsk(:,   1:Njs1) = .FALSE. 
     115      llmsk(:,Nje1: jpj) = .FALSE. 
     116      ! 
     117      llmsk(Nis0:Nie0,Njs0:Nje0) = tmask(Nis0:Nie0,Njs0:Nje0,1) == 1._wp   ! test only the inner domain 
     118      IF( COUNT( llmsk(:,:) ) > 0 ) THEN   ! avoid huge values sent back for land processors... 
     119         zmax(1) = MAXVAL(     taum(:,:)   , mask = llmsk )   ! max wind stress module 
     120         zmax(2) = MAXVAL( ABS( qns(:,:) ) , mask = llmsk )   ! max non-solar heat flux 
     121         zmax(3) = MAXVAL( ABS( emp(:,:) ) , mask = llmsk )   ! max E-P 
     122      ELSE 
     123         IF( ll_colruns ) THEN    ! default value: must not be kept when calling mpp_max -> must be as small as possible 
     124            zmax(1:3) = -HUGE(1._wp) 
     125         ELSE                     ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...) 
     126            zmax(1:3) = 0._wp 
     127         ENDIF 
     128      ENDIF 
     129      zmax(4) = REAL( nstop, wp )                                     ! stop indicator 
     130      !                                   !==               get global extrema             ==! 
     131      !                                   !==  done by all processes if writting run.stat  ==! 
    100132      IF( ll_colruns ) THEN 
     133         zmaxlocal(:) = zmax(:) 
    101134         CALL mpp_max( "stpctl", zmax )          ! max over the global domain 
    102          nstop = NINT( zmax(3) )                 ! nstop indicator sheared among all local domains 
    103       ENDIF 
    104       !                                   !==  run statistics  ==!   ("run.stat" files) 
     135         nstop = NINT( zmax(4) )                 ! update nstop indicator (now sheared among all local domains) 
     136      ENDIF 
     137      !                                   !==              write "run.stat" files              ==! 
     138      !                                   !==  done only by 1st subdomain at writting timestep  ==! 
    105139      IF( ll_wrtruns ) THEN 
    106140         WRITE(numrun,9500) kt, zmax(1), zmax(2), zmax(3) 
    107          istatus = NF90_PUT_VAR( idrun, idtau, (/ zmax(1)/), (/kt/), (/1/) ) 
    108          istatus = NF90_PUT_VAR( idrun, idqns, (/ zmax(2)/), (/kt/), (/1/) ) 
    109          istatus = NF90_PUT_VAR( idrun, idemp, (/ zmax(3)/), (/kt/), (/1/) ) 
    110          IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 
    111          IF( kt == nitend         ) istatus = NF90_CLOSE(idrun) 
     141         istatus = NF90_PUT_VAR( nrunid, nvarid(1), (/ zmax(1)/), (/kt/), (/1/) ) 
     142         istatus = NF90_PUT_VAR( nrunid, nvarid(2), (/ zmax(2)/), (/kt/), (/1/) ) 
     143         istatus = NF90_PUT_VAR( nrunid, nvarid(3), (/ zmax(3)/), (/kt/), (/1/) ) 
     144         IF( kt == nitend ) istatus = NF90_CLOSE(nrunid) 
    112145      END IF 
    113       !                                   !==  error handling  ==! 
    114       IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. (   &  ! domain contains some ocean points, check for sensible ranges 
    115          &  zmax(1) >    5._wp .OR.   &             ! too large wind stress ( > 5 N/m^2 ) 
    116          &  zmax(2) > 2000._wp .OR.   &             ! too large non-solar heat flux ( > 2000 W/m^2) 
    117          &  zmax(3) > 1.E-3_wp .OR.   &             ! too large net freshwater flux ( kg/m^2/s) 
    118          &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) ) ) THEN   ! NaN encounter in the tests 
    119  
    120          !! We are 1D so no need to find a spatial location of the rogue point. 
    121  
     146      !                                   !==               error handling               ==! 
     147      !                                   !==  done by all processes at every time step  ==! 
     148      ! 
     149      IF(   zmax(1) >    5._wp .OR.   &                   ! too large wind stress         ( > 5 N/m^2 ) 
     150         &  zmax(2) > 2000._wp .OR.   &                   ! too large non-solar heat flux ( > 2000 W/m^2 ) 
     151         &  zmax(3) > 1.E-3_wp .OR.   &                   ! too large net freshwater flux ( > 1.E-3 kg/m^2/s ) 
     152         &  ISNAN( zmax(1) + zmax(2) + zmax(3) ) .OR.   &               ! NaN encounter in the tests 
     153         &  ABS(   zmax(1) + zmax(2) + zmax(3) ) > HUGE(1._wp) ) THEN   ! Infinity encounter in the tests 
     154         ! 
     155         iloc(:,:) = 0 
     156         IF( ll_colruns ) THEN   ! zmax is global, so it is the same on all subdomains -> no dead lock with mpp_maxloc 
     157            ! first: close the netcdf file, so we can read it 
     158            IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid) 
     159            ! get global loc on the min/max 
     160            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F  
     161            CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk, zzz, iloc(1:2,2) ) 
     162            CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk, zzz, iloc(1:2,3) ) 
     163            ! find which subdomain has the max. 
     164            iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0 
     165            DO ji = 1, 4 
     166               IF( zmaxlocal(ji) == zmax(ji) ) THEN 
     167                  iareamin(ji) = narea   ;   iareamax(ji) = narea   ;   iareasum(ji) = 1 
     168               ENDIF 
     169            END DO 
     170            CALL mpp_min( "stpctl", iareamin )         ! min over the global domain 
     171            CALL mpp_max( "stpctl", iareamax )         ! max over the global domain 
     172            CALL mpp_sum( "stpctl", iareasum )         ! sum over the global domain 
     173         ELSE                    ! find local min and max locations: 
     174            ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 
     175            iloc(1:2,1) = MAXLOC(     taum(:,:)  , mask = llmsk ) 
     176            iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk ) 
     177            iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk ) 
     178            DO ji = 1, 3   ! local domain indices ==> global domain indices, excluding halos 
     179               iloc(1:2,ji) = (/ mig0(iloc(1,ji)), mjg0(iloc(2,ji)) /) 
     180            END DO 
     181            iareamin(:) = narea   ;   iareamax(:) = narea   ;   iareasum(:) = 1         ! this is local information 
     182         ENDIF 
     183         ! 
    122184         WRITE(ctmp1,*) ' stp_ctl: |tau_mod| > 5 N/m2  or  |qns| > 2000 W/m2  or |emp| > 1.E-3 or  NaN encounter in the tests' 
    123          WRITE(ctmp2,9500) kt,   zmax(1), zmax(2), zmax(3) 
    124          WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort.nc file' 
    125  
     185         CALL wrt_line( ctmp2, kt, '|tau| max',  zmax(1), iloc(:,1), iareasum(1), iareamin(1), iareamax(1) ) 
     186         CALL wrt_line( ctmp3, kt, '|qns| max',  zmax(2), iloc(:,2), iareasum(2), iareamin(2), iareamax(2) ) 
     187         CALL wrt_line( ctmp4, kt, 'emp   max',  zmax(3), iloc(:,3), iareasum(3), iareamin(3), iareamax(3) ) 
     188         IF( Agrif_Root() ) THEN 
     189            WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort* files' 
     190         ELSE 
     191            WRITE(ctmp6,*) '      ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files' 
     192         ENDIF 
     193         ! 
    126194         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file 
    127  
    128          IF( .NOT. sn_cfctl%l_glochk ) THEN 
    129             WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 
    130             CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' ) 
    131          ELSE 
    132             CALL ctl_stop( ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' ) 
    133          ENDIF 
    134  
    135          kindic = -3 
    136          ! 
     195         ! 
     196         IF( ll_colruns .or. jpnij == 1 ) THEN   ! all processes synchronized -> use lwp to print in opened ocean.output files 
     197            IF(lwp) THEN   ;   CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     198            ELSE           ;   nstop = MAX(1, nstop)   ! make sure nstop > 0 (automatically done when calling ctl_stop) 
     199            ENDIF 
     200         ELSE                                    ! only mpi subdomains with errors are here -> STOP now 
     201            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 
     202         ENDIF 
     203         ! 
     204      ENDIF 
     205      ! 
     206      IF( nstop > 0 ) THEN                                                  ! an error was detected and we did not abort yet... 
     207         ngrdstop = Agrif_Fixed()                                           ! store which grid got this error 
     208         IF( .NOT. ll_colruns .AND. jpnij > 1 )   CALL ctl_stop( 'STOP' )   ! we must abort here to avoid MPI deadlock 
    137209      ENDIF 
    138210      ! 
     
    140212      ! 
    141213   END SUBROUTINE stp_ctl 
     214 
     215 
     216   SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax ) 
     217      !!---------------------------------------------------------------------- 
     218      !!                     ***  ROUTINE wrt_line  *** 
     219      !! 
     220      !! ** Purpose :   write information line 
     221      !! 
     222      !!---------------------------------------------------------------------- 
     223      CHARACTER(len=*),      INTENT(  out) ::   cdline 
     224      CHARACTER(len=*),      INTENT(in   ) ::   cdprefix 
     225      REAL(wp),              INTENT(in   ) ::   pval 
     226      INTEGER, DIMENSION(3), INTENT(in   ) ::   kloc 
     227      INTEGER,               INTENT(in   ) ::   kt, ksum, kmin, kmax 
     228      ! 
     229      CHARACTER(len=80) ::   clsuff 
     230      CHARACTER(len=9 ) ::   clkt, clsum, clmin, clmax 
     231      CHARACTER(len=9 ) ::   cli, clj, clk 
     232      CHARACTER(len=1 ) ::   clfmt 
     233      CHARACTER(len=4 ) ::   cl4   ! needed to be able to compile with Agrif, I don't know why 
     234      INTEGER           ::   ifmtk 
     235      !!---------------------------------------------------------------------- 
     236      WRITE(clkt , '(i9)') kt 
     237       
     238      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij  ,wp))) + 1     ! how many digits to we need to write ? (we decide max = 9) 
     239      !!! WRITE(clsum, '(i'//clfmt//')') ksum                   ! this is creating a compilation error with AGRIF 
     240      cl4 = '(i'//clfmt//')'   ;   WRITE(clsum, cl4) ksum 
     241      WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1    ! how many digits to we need to write ? (we decide max = 9) 
     242      cl4 = '(i'//clfmt//')'   ;   WRITE(clmin, cl4) kmin-1 
     243                                   WRITE(clmax, cl4) kmax-1 
     244      ! 
     245      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1      ! how many digits to we need to write jpiglo? (we decide max = 9) 
     246      cl4 = '(i'//clfmt//')'   ;   WRITE(cli, cl4) kloc(1)      ! this is ok with AGRIF 
     247      WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpjglo,wp))) + 1      ! how many digits to we need to write jpjglo? (we decide max = 9) 
     248      cl4 = '(i'//clfmt//')'   ;   WRITE(clj, cl4) kloc(2)      ! this is ok with AGRIF 
     249      ! 
     250      IF( ksum == 1 ) THEN   ;   WRITE(clsuff,9100) TRIM(clmin) 
     251      ELSE                   ;   WRITE(clsuff,9200) TRIM(clsum), TRIM(clmin), TRIM(clmax) 
     252      ENDIF 
     253      IF(kloc(3) == 0) THEN 
     254         ifmtk = INT(LOG10(REAL(jpk,wp))) + 1                   ! how many digits to we need to write jpk? (we decide max = 9) 
     255         clk = REPEAT(' ', ifmtk)                               ! create the equivalent in blank string 
     256         WRITE(cdline,9300) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), clk(1:ifmtk), TRIM(clsuff) 
     257      ELSE 
     258         WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1      ! how many digits to we need to write jpk? (we decide max = 9) 
     259         !!! WRITE(clk, '(i'//clfmt//')') kloc(3)               ! this is creating a compilation error with AGRIF 
     260         cl4 = '(i'//clfmt//')'   ;   WRITE(clk, cl4) kloc(3)   ! this is ok with AGRIF 
     261         WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj),    TRIM(clk), TRIM(clsuff) 
     262      ENDIF 
     263      ! 
     2649100  FORMAT('MPI rank ', a) 
     2659200  FORMAT('found in ', a, ' MPI tasks, spread out among ranks ', a, ' to ', a) 
     2669300  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j   ', a, ' ', a, ' ', a, ' ', a) 
     2679400  FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j k ', a, ' ', a, ' ', a, ' ', a) 
     268      ! 
     269   END SUBROUTINE wrt_line 
     270 
    142271 
    143272   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.