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 1325 for trunk/NEMO/OFF_SRC/opa.F90 – NEMO

Ignore:
Timestamp:
2009-02-20T11:03:39+01:00 (15 years ago)
Author:
cetlod
Message:

rewrite the offline opa.F90 module, see ticket:349

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OFF_SRC/opa.F90

    r1291 r1325  
    3333   PRIVATE 
    3434 
     35   !! * Module variables 
     36   CHARACTER (len=64) ::        & 
     37      cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
     38 
    3539   !! * Routine accessibility 
    3640   PUBLIC opa_model      ! called by model.F90 
     41   PUBLIC opa_init 
    3742   !!---------------------------------------------------------------------- 
    3843   !!   OPA 9.0 , LOCEAN-IPSL  (2005) 
     
    4752      !!                     ***  ROUTINE opa  *** 
    4853      !! 
     54      !! ** Purpose :   opa solves the primitive equations on an orthogonal 
     55      !!      curvilinear mesh on the sphere. 
     56      !! 
     57      !! ** Method  : - model general initialization 
     58      !!              - launch the time-stepping (stp routine) 
     59      !! 
     60      !! References : 
     61      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual. 
     62      !!              internal report, IPSL. 
     63      !!---------------------------------------------------------------------- 
     64      INTEGER ::   istp       ! time step index 
     65      !!---------------------------------------------------------------------- 
     66 
     67      CALL opa_init  ! Initializations 
     68 
     69      IF( lk_mpp )   CALL mpp_max( nstop ) 
     70 
     71      ! check that all process are still there... If some process have an error, 
     72      ! they will never enter in step and other processes will wait until the end of the cpu time! 
     73      IF( lk_mpp )   CALL mpp_max( nstop ) 
     74 
     75      istp = nit000 
     76         ! 
     77      DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     78         CALL stp( istp ) 
     79         istp = istp + 1 
     80         IF( lk_mpp )   CALL mpp_max( nstop ) 
     81      END DO 
     82      !                                     ! ========= ! 
     83      !                                     !  Job end  ! 
     84      !                                     ! ========= ! 
     85 
     86      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
     87 
     88      IF( nstop /= 0 .AND. lwp ) THEN                 ! error print 
     89         WRITE(numout,cform_err) 
     90         WRITE(numout,*) nstop, ' error have been found' 
     91      ENDIF 
     92 
     93      CALL opa_closefile 
     94 
     95      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp) 
     96      ! 
     97   END SUBROUTINE opa_model 
     98 
     99 
     100   SUBROUTINE opa_init 
     101      !!---------------------------------------------------------------------- 
     102      !!                     ***  ROUTINE opa_init *** 
     103      !! 
    49104      !! ** Purpose :   opa solves the primitive equations on an orthogonal  
    50105      !!      curvilinear mesh on the sphere. 
    51106      !! 
    52107      !! ** Method  : - model general initialization 
    53       !!              - launch the time-stepping (stp routine) 
    54108      !! 
    55109      !! References : 
     
    76130      !!---------------------------------------------------------------------- 
    77131      !! * Local declarations 
    78       INTEGER ::   istp       ! time step index 
    79132      CHARACTER (len=20) ::   namelistname 
    80133      CHARACTER (len=28) ::   file_out 
    81       CHARACTER (len=64) ::        & 
    82          cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
    83134 
    84135      !!---------------------------------------------------------------------- 
     
    150201      CALL istate_init                      ! ocean initial state (Dynamics and tracers) 
    151202 
    152       CALL trc_ini                           ! Passive tracers 
     203!!!!      CALL trc_ini                           ! Passive tracers 
    153204 
    154205      CALL day_init                          ! Calendar 
     
    157208      !                                     ! Ocean physics 
    158209      CALL tra_qsr_init                         ! Solar radiation penetration 
     210 
     211      CALL trc_ini                           ! Passive tracers 
    159212 
    160213#if ! defined key_off_degrad 
     
    167220      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
    168221 
    169       istp = nit000 
    170       DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    171          CALL stp( istp ) 
    172          istp = istp + 1 
    173       END DO 
    174       !                                     ! ========= ! 
    175       !                                     !  Job end  ! 
    176       !                                     ! ========= ! 
    177  
    178       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
    179  
    180       IF( nstop /= 0 ) THEN                 ! error print 
    181       IF(lwp) WRITE(numout,cform_err) 
    182       IF(lwp) WRITE(numout,*) nstop, ' error have been found'  
    183       ENDIF 
    184  
    185       IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp) 
    186  
    187    END SUBROUTINE opa_model 
     222   END SUBROUTINE opa_init 
     223 
     224   SUBROUTINE opa_closefile 
     225      !!---------------------------------------------------------------------- 
     226      !!                     ***  ROUTINE opa_closefile  *** 
     227      !! 
     228      !! ** Purpose :   Close the files 
     229      !! 
     230      !! ** Method  : 
     231      !! 
     232      !! History : 
     233      !!   9.0  !  05-01  (O. Le Galloudec)  Original code 
     234      !!---------------------------------------------------------------------- 
     235      !!---------------------------------------------------------------------- 
     236 
     237      IF ( lk_mpp ) CALL mppsync 
     238 
     239      ! 1. Unit close 
     240      ! ------------- 
     241 
     242      CLOSE( numnam )           ! namelist 
     243      CLOSE( numout )           ! standard model output file 
     244 
     245      IF(lwp) CLOSE( numstp )   ! time-step file 
     246 
     247   END SUBROUTINE opa_closefile 
    188248 
    189249   !!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.