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 83 – NEMO

Changeset 83


Ignore:
Timestamp:
2004-04-22T15:06:06+02:00 (20 years ago)
Author:
opalod
Message:

CT : UPDATE056 : Change the subroutine name cpl_step to cpl_stp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/cpl.F90

    r15 r83  
    1010   !!   cpl_init     : initialization of coupled mode communication 
    1111   !!   cpl_read     : read the coupled namelist 
    12    !!   cpl_step     : exchange fields in coupled mode 
     12   !!   cpl_stp      : exchange fields in coupled mode 
    1313   !!---------------------------------------------------------------------- 
    1414   !! * Modules used 
     
    2424 
    2525   !! Routine accessibility 
    26    PUBLIC cpl_init 
    27    PUBLIC cpl_step  ! routine called by step.F90 
     26   PUBLIC cpl_init     ! routine called in opa module 
     27   PUBLIC cpl_stp      ! routine called in step module 
    2828   !!---------------------------------------------------------------------- 
    2929   !!   OPA 9.0 , LODYC-IPSL  (2003) 
     
    114114 
    115115         DO jf = 1, nflxc2o   
    116             ! CALL PIPE_Model_Define(numout,cpl_readflx(jf),jpread,info) 
     116            ! CALL PIPE_Model_Define( numout, cpl_readflx(jf), jpread, info ) 
    117117            IF( info /= 0 ) ierror = ierror + 1 
    118118         END DO 
    119119         DO jf = 1, ntauc2o 
    120             ! CALL PIPE_Model_Define(numout,cpl_readtau(jf),jpread,info) 
     120            ! CALL PIPE_Model_Define( numout, cpl_readtau(jf), jpread, info ) 
    121121            IF( info /= 0 ) ierror = ierror + 1 
    122122         END DO 
     
    129129 
    130130         DO jf = 1, nfldo2c 
    131             ! CALL PIPE_Model_Define(numout, cpl_writ(jf), jpwrit, info) 
     131            ! CALL PIPE_Model_Define( numout, cpl_writ(jf), jpwrit, info ) 
    132132            IF( info /= 0 ) ierror = ierror + 1 
    133133         END DO 
    134134 
    135135         IF( ierror /= 0 ) THEN 
    136             IF(lwp) WRITE(numout,*) 'Error in pipes definitions' 
    137             IF(lwp) WRITE(numout,*) 'STOP cpl_init' 
     136            IF(lwp) WRITE(numout,*) 
     137            IF(lwp) WRITE(numout,*) 'cpl_init: end of job due to error in pipes definitions' 
    138138            CALL abort 
    139139         END IF 
     
    141141         IF(lwp) WRITE(numout,*) 
    142142         IF(lwp) WRITE(numout,*) 'All pipes have been made' 
    143          IF(lwp) WRITE(numout,*) 
    144143          
    145144         IF(lwp) WRITE(numout,*) 
    146145         IF(lwp) WRITE(numout,*) 'Communication test between OCE and CPL' 
    147          IF(lwp) WRITE(numout,*) 
    148146         CALL flush(numout) 
    149147          
     
    151149          
    152150         IF( ierror /= 0 ) THEN 
    153             IF(lwp) WRITE(numout,*) 'Error in exchange first informations with Oasis'  
    154             IF(lwp) WRITE(numout,*) 'STOP cpl_init' 
     151            IF(lwp) WRITE(numout,*) 
     152            IF(lwp) WRITE(numout,*) 'cpl_init: end of job due to error in exchange first informations with Oasis' 
    155153            CALL abort 
    156154         END IF 
     
    162160         IF(lwp) WRITE(numout,*) ' value of oasis timestep  is    = ',imesso(3) 
    163161         IF(lwp) WRITE(numout,*) ' process id for oasis  is       = ',imesso(4) 
    164          IF(lwp) WRITE(numout,*) 
    165162         CALL flush(numout) 
    166163          
     
    176173         ! CALL SVIPC_debug(1) 
    177174 
    178  
    179          ! 1.1-Define the experiment name : 
     175         ! Define the experiment name : 
    180176 
    181177          cljobnam = 'IPC'      ! as $JOBNAM in namcouple 
    182178 
    183           ! 3-Attach to shared memory pool used to exchange initial infos  
     179          ! Attach to shared memory pool used to exchange initial infos  
    184180 
    185181          info = 0 
     
    193189          ENDIF 
    194190 
    195           ! 4-Attach to pools used to exchange fields from ocean to coupler 
     191          ! Attach to pools used to exchange fields from ocean to coupler 
    196192 
    197193          DO jf = 1, nfldo2c 
     
    203199          END DO 
    204200 
    205           ! 5-Attach to pools used to exchange fields from coupler to ocean 
     201          ! Attach to pools used to exchange fields from coupler to ocean 
    206202           
    207203          DO jf = 1, nflxc2o 
     
    221217          END DO  
    222218 
    223           ! 6-Exchange of initial infos 
     219          ! Exchange of initial infos 
    224220 
    225221          ! Write data array isend to pool READ by Oasis 
     
    310306 
    311307         IF( info /= clim_ok ) THEN 
    312             IF(lwp) WRITE( numout, *) ' cpl_init : pb init clim ' 
    313             IF(lwp) WRITE( numout, *) ' error code is = ', info 
    314             CALL abort('STOP in cpl_init') 
     308            IF(lwp) WRITE( numout, *) 'cpl_init : pb init clim, error code is = ', info 
     309            CALL abort( 'STOP in cpl_init' ) 
    315310         ELSE 
    316311            IF(lwp) WRITE(numout,*) 'cpl_init : init clim ok ' 
     
    336331         IF(lwp) WRITE(numout,*) 'cpl_init : clim_define ok ' 
    337332          
    338          CALL CLIM_Start ( imxtag, info ) 
     333         CALL CLIM_Start( imxtag, info ) 
    339334          
    340335         IF( info /= clim_ok ) THEN 
    341             IF(lwp) WRITE(numout,*) 'cpl_init : pb start clim ' 
    342             IF(lwp) WRITE(numout,*) ' error code is = ', info 
    343             CALL abort('stop in cpl_init') 
     336            IF(lwp) WRITE(numout,*) 'cpl_init : pb start clim, error code is = ', info 
     337            CALL abort( 'stop in cpl_init' ) 
    344338         ELSE 
    345339            IF(lwp) WRITE(numout,*) 'cpl_init : start clim ok ' 
     
    366360      !!                  ***  ROUTINE cpl_read  *** 
    367361      !!                     
    368       !! ** Purpose : 
    369       !!     Read and print options for the coupled run (namelist) 
    370       !! 
    371       !! ** Method :                   : no 
     362      !! ** Purpose :   Read and print options for the coupled run (namelist) 
     363      !! 
     364      !! ** Method  :   ??? 
    372365      !! 
    373366      !! History : 
     
    491484 
    492485 
    493    SUBROUTINE cpl_step( kt ) 
     486   SUBROUTINE cpl_stp( kt ) 
    494487      !!--------------------------------------------------------------------- 
    495       !!                  ***  ROUTINE cpl_step  *** 
     488      !!                  ***  ROUTINE cpl_stp  *** 
    496489      !!                      ***************** 
    497490      !!                      * OASIS routine * 
     
    589582#else 
    590583      alboc(:,:) = alboc(:,:) + freeze(:,:) * 0.8 
    591       ticoc(:,:) = ticoc(:,:) + freeze(:,:) * ( -10.0 + rt0 ) 
     584      ticoc(:,:) = ticoc(:,:) + freeze(:,:) * ( -10.e0 + rt0 ) 
    592585#endif 
    593586 
     
    596589      !--------------------------------- 
    597590 
    598       IF( MOD(kt,nexco) == 0 ) THEN 
     591      IF( MOD( kt, nexco ) == 0 ) THEN 
    599592 
    600593         ! 2.1 Average : mean coupling fields 
    601          DO jj = 1, jpjglo 
    602             DO ji = 1, jpiglo 
    603                zstoc (ji,jj) = 0.e0 
    604                zieoc (ji,jj) = 0.e0 
    605                zalboc(ji,jj) = 0.e0 
    606                zticoc(ji,jj) = 0.e0 
    607             END DO 
    608          END DO 
     594         zstoc (:,:) = 0.e0 
     595         zieoc (:,:) = 0.e0 
     596         zalboc(:,:) = 0.e0 
     597         zticoc(:,:) = 0.e0 
    609598         DO jj = 1, nlcj 
    610599            DO ji = 1, nlci 
     
    617606         icstep = kt - nit000 + 1 
    618607 
    619          WRITE(numout,*) ' ' 
     608         WRITE(numout,*) 
    620609         WRITE(numout,*) 'STEP: Send fields to CPL with kt= ', kt 
    621          WRITE(numout,*) ' ' 
     610         WRITE(numout,*) 
    622611 
    623612         ! outputs 
     
    635624            ! finalize outputs 
    636625 
    637             CALL histclo(nidcs) 
     626            CALL histclo( nidcs ) 
    638627 
    639628            ! WRITE fields for coupler with pipe technique or for last time step 
     
    663652                  iflmax = iflmax + 1               ! increment the number of different files 
    664653                  clfile(iflmax) = cpl_f_writ(jf)   ! keep file name 
    665                   ifile(iflmax) = iunmax            ! keep file unit for file 
     654                  ifile (iflmax) = iunmax           ! keep file unit for file 
    666655                  ifield(jf) = ifile(iflmax)        ! keep file unit for field 
    667656                  iunmax = iunmax-1                 ! decrement unit maximum number from 99 to 98... 
     
    674663            !               
    675664            DO jf = 1, nfldo2c 
    676                IF(jf == 1) CALL locwrite(cpl_writ(jf),zstoc , isize, ifield(jf), ierror, numout)  
    677                IF(jf == 2) CALL locwrite(cpl_writ(jf),zieoc , isize, ifield(jf), ierror, numout)  
    678                IF(jf == 3) CALL locwrite(cpl_writ(jf),zalboc, isize, ifield(jf), ierror, numout)  
    679                IF(jf == 4) CALL locwrite(cpl_writ(jf),zticoc, isize, ifield(jf), ierror, numout)  
     665               IF( jf == 1 ) CALL locwrite(cpl_writ(jf),zstoc , isize, ifield(jf), ierror, numout)  
     666               IF( jf == 2 ) CALL locwrite(cpl_writ(jf),zieoc , isize, ifield(jf), ierror, numout)  
     667               IF( jf == 3 ) CALL locwrite(cpl_writ(jf),zalboc, isize, ifield(jf), ierror, numout)  
     668               IF( jf == 4 ) CALL locwrite(cpl_writ(jf),zticoc, isize, ifield(jf), ierror, numout)  
    680669            END DO 
    681670 
     
    683672 
    684673            DO jn = 1, iflmax  
    685                CLOSE (ifile(jn)) 
     674               CLOSE( ifile(jn) ) 
    686675            END DO 
    687676 
    688677            ! Clim mode 
    689678            IF( cchan == 'CLIM' ) THEN  ! inform PVM daemon, I have finished 
    690                CALL CLIM_Quit (CLIM_ContPvm, info) 
    691                IF(info /= CLIM_Ok) THEN 
     679               CALL CLIM_Quit( CLIM_ContPvm, info ) 
     680               IF( info /= CLIM_Ok ) THEN 
    692681                  WRITE (6, *) 'An error occured while leaving CLIM. Error = ',info 
    693682               ENDIF 
     
    696685         ENDIF 
    697686 
    698          ! IF last we have finished 
    699  
    700          IF (kt == nitend ) RETURN  
    701  
    702          ! 2.3 normal exchange 
    703  
    704          ! PIPE mode       
    705          IF( cchan == 'PIPE' ) THEN  
    706  
    707             ! Send message to pipes for CPL=atmosphere 
    708  
    709             ! DO jf = 1, nfldo2c 
    710             !    CALL PIPE_Model_Send(cpl_writ(jf), icstep, numout) 
    711             ! END DO  
    712  
    713             ! SIPC mode 
    714          ELSE IF( cchan == 'SIPC' ) THEN 
    715  
    716             ! Define IF a header must be encapsulated within the field brick : 
    717             clmodinf = 'NOT'  ! as $MODINFO in namcouple   
    718  
    719             ! IF clmodinf = 'YES', define encapsulated infos to be exchanged 
    720             !    infos(1) = initial date 
    721             !    infos(2) = timestep 
    722             !    infos(3) = actual time 
    723             ! 
    724             ! Writing of output field SST SOSSTSST 
    725             ! 
    726             ! Index of SST in total number of fields jpfldo2a:  
    727             index = 1 
    728             ! 
    729             ! CALL SIPC_Write_Model(index, isize, clmodinf, cljobnam, infos, zstoc) 
    730             ! 
    731             ! Writing of output field Sea-Ice SOICECOV  
    732             ! 
    733             ! Index of sea-ice in total number of fields jpfldo2a:  
    734             index = 2 
    735             ! 
    736             ! CALL SIPC_Write_Model(index, isize, clmodinf, cljobnam, infos, zieoc) 
    737  
    738             ! CLIM mode 
    739          ELSE IF( cchan == 'CLIM' ) THEN 
    740  
    741             DO jn = 1, nfldo2c 
    742  
    743                IF (jn == 1) CALL CLIM_Export(cpl_writ(jn), icstep, zstoc , info) 
    744                IF (jn == 2) CALL CLIM_Export(cpl_writ(jn), icstep, zieoc , info) 
    745                IF (jn == 3) CALL CLIM_Export(cpl_writ(jn), icstep, zalboc, info) 
    746                IF (jn == 4) CALL CLIM_Export(cpl_writ(jn), icstep, zticoc, info) 
    747  
    748                IF (info /= CLIM_Ok) THEN 
    749                   WRITE (numout,*) 'STEP : Pb giving', cpl_writ(jn), ':', jn 
    750                   WRITE (numout,*) ' at timestep = ', icstep, 'kt = ', kt 
    751                   WRITE (numout,*) 'Clim error code is = ',info 
    752                   WRITE (numout,*) 'STOP in stpcpl ' 
    753                   CALL abort(' stpcpl ') 
    754                ENDIF 
    755             END DO 
     687         ! IF last we have finished if not pass info to the atmosphere 
     688 
     689         IF ( kt /= nitend ) THEN 
     690 
     691            ! 2.3 normal exchange 
     692 
     693            ! PIPE mode       
     694            IF( cchan == 'PIPE' ) THEN  
     695 
     696               ! Send message to pipes for CPL=atmosphere 
     697 
     698               ! DO jf = 1, nfldo2c 
     699               !    CALL PIPE_Model_Send(cpl_writ(jf), icstep, numout) 
     700               ! END DO  
     701 
     702               ! SIPC mode 
     703            ELSE IF( cchan == 'SIPC' ) THEN 
     704 
     705               ! Define IF a header must be encapsulated within the field brick : 
     706               clmodinf = 'NOT'  ! as $MODINFO in namcouple   
     707 
     708               ! IF clmodinf = 'YES', define encapsulated infos to be exchanged 
     709               !    infos(1) = initial date 
     710               !    infos(2) = timestep 
     711               !    infos(3) = actual time 
     712               ! 
     713               ! Writing of output field SST SOSSTSST 
     714               ! 
     715               ! Index of SST in total number of fields jpfldo2a:  
     716               index = 1 
     717               ! 
     718               ! CALL SIPC_Write_Model(index, isize, clmodinf, cljobnam, infos, zstoc) 
     719               ! 
     720               ! Writing of output field Sea-Ice SOICECOV  
     721               ! 
     722               ! Index of sea-ice in total number of fields jpfldo2a:  
     723               index = 2 
     724               ! 
     725               ! CALL SIPC_Write_Model(index, isize, clmodinf, cljobnam, infos, zieoc) 
     726    
     727               ! CLIM mode 
     728            ELSE IF( cchan == 'CLIM' ) THEN 
     729    
     730               DO jn = 1, nfldo2c 
     731    
     732                  IF (jn == 1) CALL CLIM_Export(cpl_writ(jn), icstep, zstoc , info) 
     733                  IF (jn == 2) CALL CLIM_Export(cpl_writ(jn), icstep, zieoc , info) 
     734                  IF (jn == 3) CALL CLIM_Export(cpl_writ(jn), icstep, zalboc, info) 
     735                  IF (jn == 4) CALL CLIM_Export(cpl_writ(jn), icstep, zticoc, info) 
     736 
     737                  IF (info /= CLIM_Ok) THEN 
     738                     WRITE (numout,*) 'STEP : Pb giving', cpl_writ(jn), ':', jn 
     739                     WRITE (numout,*) ' at timestep = ', icstep, 'kt = ', kt 
     740                     WRITE (numout,*) 'Clim error code is = ',info 
     741                     WRITE (numout,*) 'STOP in stpcpl ' 
     742                     CALL abort(' stpcpl ') 
     743                  ENDIF 
     744               END DO 
     745            ENDIF 
     746 
     747            ! reset cumulative sst and sea-ice extend to zero 
     748            sstoc(:,:) = 0.e0 
     749            sieoc(:,:) = 0.e0 
     750            alboc(:,:) = 0.e0 
     751            ticoc(:,:) = 0.e0 
    756752         ENDIF 
    757  
    758          ! reset cumulative sst and sea-ice extend to zero 
    759          sstoc(:,:) = 0.0 
    760          sieoc(:,:) = 0.0 
    761          alboc(:,:) = 0.0 
    762          ticoc(:,:) = 0.0 
    763753      ENDIF 
    764754 
    765    END SUBROUTINE cpl_step 
     755   END SUBROUTINE cpl_stp 
    766756 
    767757#else 
     
    770760   !!---------------------------------------------------------------------- 
    771761CONTAINS 
    772    SUBROUTINE cpl_init       ! Dummy routine 
     762   SUBROUTINE cpl_init            ! Dummy routine 
     763      WRITE(*,*) 'cpl_init: You should have not see this print! error?' 
    773764   END SUBROUTINE cpl_init 
    774    SUBROUTINE cpl_step( kt )       ! Dummy routine 
    775       WRITE(*,*) 'cpl_step: You should have not see this print! error?', kt 
    776    END SUBROUTINE cpl_step 
     765   SUBROUTINE cpl_stp( kt )       ! Dummy routine 
     766      WRITE(*,*) 'cpl_stp: You should have not see this print! error?', kt 
     767   END SUBROUTINE cpl_stp 
    777768#endif 
    778769 
Note: See TracChangeset for help on using the changeset viewer.