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

Ignore:
Timestamp:
2006-05-10T19:44:38+02:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_update_057:RB: step and opa reorganization

File:
1 edited

Legend:

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

    r440 r467  
    77   !!---------------------------------------------------------------------- 
    88   !!   opa_model      : solve ocean dynamics, tracer and/or sea-ice 
     9   !!   opa_init       : initialization of the opa model 
    910   !!   opa_flg        : initialisation of algorithm flag  
    1011   !!   opa_closefile  : close remaining files 
     12   !!---------------------------------------------------------------------- 
     13   !! History : 
     14   !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code 
     15   !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec) 
     16   !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti, 
     17   !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, 
     18   !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1  
     19   !!        !  92-06  (L.Terray) coupling implementation 
     20   !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice  
     21   !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti, 
     22   !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray, 
     23   !!                   M.A. Filiberti, J. Vialar, A.M. Treguier, 
     24   !!                   M. Levy)  release 8.0 
     25   !!   8.1  !  97-06  (M. Imbard, G. Madec) 
     26   !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model  
     27   !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP  
     28   !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
     29   !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules 
     30   !!    "   !  04-08  (C. Talandier) New trends organization 
     31   !!    "   !  05-06  (C. Ethe) Add the 1D configuration possibility 
     32   !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization 
     33   !!    "   !  06-03  (L. Debreu, C. Mazauric)  Agrif implementation 
     34   !!    "   !  06-04  (G. Madec, R. Benshila)  Step reorganization 
    1135   !!---------------------------------------------------------------------- 
    1236   !! * Modules used 
     
    3054 
    3155   ! ocean physics 
    32    USE traqsr          ! solar radiation penetration   (tra_qsr_init routine) 
    3356   USE ldfdyn          ! lateral viscosity setting      (ldfdyn_init routine) 
    3457   USE ldftra          ! lateral diffusivity setting    (ldftra_init routine) 
     
    5982   PRIVATE 
    6083 
     84   !! * Module variables 
     85   CHARACTER (len=64) ::        & 
     86      cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
     87 
    6188   !! * Routine accessibility 
    6289   PUBLIC opa_model      ! called by model.F90 
     
    6592   !!  OPA 9.0 , LOCEAN-IPSL (2005)  
    6693   !! $Header$  
    67    !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt  
     94   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    6895   !!---------------------------------------------------------------------- 
    6996 
     
    83110      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual. 
    84111      !!              internal report, IPSL. 
    85       !! 
    86       !! History : 
    87       !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code 
    88       !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec) 
    89       !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti, 
    90       !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud, 
    91       !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1  
    92       !!        !  92-06  (L.Terray) coupling implementation 
    93       !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice  
    94       !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti, 
    95       !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray, 
    96       !!                   M.A. Filiberti, J. Vialar, A.M. Treguier, 
    97       !!                   M. Levy)  release 8.0 
    98       !!   8.1  !  97-06  (M. Imbard, G. Madec) 
    99       !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model  
    100       !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP  
    101       !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER) 
    102       !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules 
    103       !!    "   !  04-08  (C. Talandier) New trends organization 
    104       !!    "   !  05-06  (C. Ethe) Add the 1D configuration possibility 
    105       !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization 
    106       !!---------------------------------------------------------------------- 
    107       !! * Local declarations 
     112      !!---------------------------------------------------------------------- 
    108113      INTEGER ::   istp       ! time step index 
    109       CHARACTER (len=64) ::        & 
    110          cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
    111114      !!---------------------------------------------------------------------- 
    112115 
    113116#if defined key_agrif 
    114  
    115       Call Agrif_Init_Grids() 
     117      CALL Agrif_Init_Grids() 
    116118#endif 
    117119       
    118       Call opa_init  ! Initializations 
    119  
    120       IF( lk_cfg_1d  ) THEN  
     120      CALL opa_init  ! Initializations 
     121 
     122      IF( lk_cfg_1d ) THEN  
    121123         istp = nit000 
    122124         DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
     
    156158 
    157159 
     160   SUBROUTINE opa_init 
     161      !!---------------------------------------------------------------------- 
     162      !!                     ***  ROUTINE opa_init  *** 
     163      !! 
     164      !! ** Purpose :   initialization of the opa model 
     165      !! 
     166      !!---------------------------------------------------------------------- 
     167#if defined key_coupled 
     168      INTEGER ::   itro, istp0        ! ??? 
     169#endif 
     170      CHARACTER (len=20) ::   namelistname 
     171      CHARACTER (len=28) ::   file_out 
     172      !!---------------------------------------------------------------------- 
     173 
     174      ! Initializations 
     175      ! =============== 
     176 
     177      file_out = 'ocean.output' 
     178       
     179      ! open listing and namelist units 
     180      IF ( numout /= 0 .AND. numout /= 6 ) THEN  
     181         CALL ctlopn( numout, file_out, 'UNKNOWN', 'FORMATTED',   & 
     182            &         'SEQUENTIAL', 1, numout, .FALSE., 1 ) 
     183      ENDIF 
     184 
     185      namelistname = 'namelist' 
     186      CALL ctlopn( numnam, namelistname, 'OLD', 'FORMATTED', 'SEQUENTIAL',   & 
     187         &           1, numout, .FALSE., 1 ) 
     188 
     189      WRITE(numout,*) 
     190      WRITE(numout,*) '                 L O D Y C - I P S L' 
     191      WRITE(numout,*) '                     O P A model' 
     192      WRITE(numout,*) '            Ocean General Circulation Model' 
     193      WRITE(numout,*) '               version OPA 9.0  (2005) ' 
     194      WRITE(numout,*) 
     195      WRITE(numout,*) 
     196 
     197      ! Nodes selection 
     198      narea = mynode() 
     199      narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 ) 
     200      lwp   = narea == 1 
     201 
     202      !                                     ! ============================== ! 
     203      !                                     !  Model general initialization  ! 
     204      !                                     ! ============================== ! 
     205 
     206      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
     207 
     208                                            ! Domain decomposition 
     209      IF( jpni*jpnj == jpnij ) THEN 
     210         CALL mpp_init                          ! standard cutting out 
     211      ELSE 
     212         CALL mpp_init2                         ! eliminate land processors 
     213      ENDIF 
     214       
     215      CALL phy_cst                          ! Physical constants 
     216 
     217      CALL dom_cfg                          ! Domain configuration 
     218       
     219      CALL dom_init                         ! Domain 
     220 
     221      IF( ln_ctl )      CALL prt_ctl_init   ! Print control 
     222 
     223      IF( lk_cfg_1d )   CALL fcorio_1d      ! redefine Coriolis at T-point 
     224 
     225      IF( lk_obc    )   CALL obc_init       ! Open boundaries  
     226 
     227      CALL day( nit000 )                    ! Calendar 
     228 
     229      CALL istate_init                      ! ocean initial state (Dynamics and tracers) 
     230 
     231      IF( lk_dynspg_flt .OR. lk_dynspg_rl ) THEN 
     232         CALL solver_init( nit000 )         ! Elliptic solver 
     233      ENDIF 
     234 
     235!!add 
     236                       CALL eos( tb, sb, rhd, rhop )        ! before potential and in situ densities 
     237 
     238                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
     239 
     240      IF( ln_zps .AND. .NOT. lk_cfg_1d )   & 
     241         &             CALL zps_hde( nit000, tb, sb, rhd,  &  ! Partial steps: before Horizontal DErivative 
     242                                            gtu, gsu, gru, &  ! of t, s, rd at the bottom ocean level 
     243                                            gtv, gsv, grv ) 
     244!!add 
     245 
     246      CALL oc_fz_pt                         ! Surface freezing point 
     247 
     248#if defined key_ice_lim 
     249      CALL ice_init                         ! Sea ice model 
     250#endif 
     251 
     252      !                                     ! Ocean scheme 
     253 
     254      CALL opa_flg                              ! Choice of algorithms 
     255 
     256      !                                     ! Ocean physics 
     257 
     258      CALL ldf_dyn_init                         ! Lateral ocean momentum physics 
     259 
     260      CALL ldf_tra_init                         ! Lateral ocean tracer physics 
     261 
     262      CALL zdf_init                             ! Vertical ocean physics 
     263 
     264      !                                     ! Ocean trends 
     265      ! Control parameters  
     266      IF( lk_trdtra .OR. lk_trdmld )   l_trdtra = .TRUE. 
     267      IF( lk_trddyn .OR. lk_trdvor )   l_trddyn = .TRUE. 
     268 
     269      IF( lk_trddyn .OR. lk_trdtra )   & 
     270         &            CALL trd_icp_init         ! active tracers and/or momentum 
     271 
     272      IF( lk_trdmld ) CALL trd_mld_init         ! mixed layer 
     273 
     274      IF( lk_trdvor ) CALL trd_vor_init         ! vorticity 
     275 
     276#if defined key_passivetrc 
     277      CALL ini_trc                           ! Passive tracers 
     278#endif 
     279 
     280#if defined key_coupled 
     281      itro  = nitend - nit000 + 1           ! Coupled 
     282      istp0 = NINT( rdt ) 
     283      CALL cpl_init( itro, nexco, istp0 )   ! Signal processing and process id exchange 
     284#endif 
     285 
     286      CALL flx_init                         ! Thermohaline forcing initialization 
     287 
     288      CALL flx_fwb_init                     ! FreshWater Budget correction 
     289 
     290      CALL dia_ptr_init                     ! Poleward TRansports initialization 
     291 
     292      !                                     ! =============== ! 
     293      !                                     !  time stepping  ! 
     294      !                                     ! =============== ! 
     295 
     296      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
     297 
     298      IF( lk_cfg_1d  )  THEN  
     299         CALL init_1d 
     300      ENDIF 
     301 
     302   END SUBROUTINE opa_init 
     303 
     304 
    158305   SUBROUTINE opa_flg 
    159306      !!---------------------------------------------------------------------- 
     
    173320      !!---------------------------------------------------------------------- 
    174321 
    175       ! Read Namelist namflg : algorithm FLaG  
     322      ! Read Namelist namflg : algorithm FLaG 
    176323      ! -------------------- 
    177324      REWIND ( numnam ) 
     
    193340   END SUBROUTINE opa_flg 
    194341 
     342 
    195343   SUBROUTINE opa_closefile 
    196344      !!---------------------------------------------------------------------- 
     
    198346      !! 
    199347      !! ** Purpose :   Close the files 
    200       !!            
    201       !! ** Method  :  
     348      !! 
     349      !! ** Method  : 
    202350      !! 
    203351      !! History : 
     
    236384 
    237385   !!====================================================================== 
    238    SUBROUTINE opa_init 
    239       !!---------------------------------------------------------------------- 
    240       !!                     ***  ROUTINE opa_init  *** 
    241       !! 
    242       !! ** Purpose :   initialization of the opa model 
    243       !! 
    244       !! ** Method  :  
    245       !! 
    246       !! References : 
    247       !!---------------------------------------------------------------------- 
    248       !! * Local declarations 
    249  
    250 #if defined key_coupled 
    251       INTEGER ::   itro, istp0        ! ??? 
    252 #endif 
    253       CHARACTER (len=64) ::        & 
    254          cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing 
    255       CHARACTER (len=20) :: namelistname 
    256       CHARACTER (len=28) :: file_out 
    257       !!---------------------------------------------------------------------- 
    258  
    259       ! Initializations 
    260       ! =============== 
    261  
    262       file_out = 'ocean.output' 
    263        
    264       ! open listing and namelist units 
    265       IF ( numout /= 0 .AND. numout /= 6 ) THEN  
    266          CALL ctlopn(numout,file_out,'UNKNOWN', 'FORMATTED',   & 
    267                       'SEQUENTIAL',1,numout,.FALSE.,1) 
    268 !         OPEN( UNIT=numout, FILE=TRIM(file_out), FORM='FORMATTED' ) 
    269       ENDIF 
    270  
    271       namelistname = 'namelist' 
    272       CALL ctlopn(numnam,namelistname,'OLD', 'FORMATTED', 'SEQUENTIAL',   & 
    273                      1,numout,.FALSE.,1) 
    274 !!!!      OPEN( UNIT=numnam, FILE='namelist', FORM='FORMATTED', STATUS='OLD' ) 
    275  
    276       WRITE(numout,*) 
    277       WRITE(numout,*) '                 L O D Y C - I P S L' 
    278       WRITE(numout,*) '                     O P A model' 
    279       WRITE(numout,*) '            Ocean General Circulation Model' 
    280       WRITE(numout,*) '               version OPA 9.0  (2005) ' 
    281       WRITE(numout,*) 
    282       WRITE(numout,*) 
    283  
    284       ! Nodes selection 
    285       narea = mynode() 
    286       narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 ) 
    287       lwp   = narea == 1 
    288  
    289       !                                     ! ============================== ! 
    290       !                                     !  Model general initialization  ! 
    291       !                                     ! ============================== ! 
    292  
    293       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
    294  
    295                                             ! Domain decomposition 
    296       IF( jpni*jpnj == jpnij ) THEN 
    297          CALL mpp_init                          ! standard cutting out 
    298       ELSE 
    299          CALL mpp_init2                         ! eliminate land processors 
    300       ENDIF 
    301        
    302       CALL phy_cst                          ! Physical constants 
    303  
    304       CALL dom_cfg                          ! Domain configuration 
    305        
    306       CALL dom_init                         ! Domain 
    307       IF( ln_ctl )      CALL prt_ctl_init   ! Print control 
    308  
    309       IF( lk_cfg_1d )   CALL fcorio_1d      ! redefine Coriolis at T-point 
    310  
    311       IF( lk_obc    )   CALL obc_init       ! Open boundaries  
    312  
    313       CALL day( nit000 )                    ! Calendar 
    314  
    315       CALL istate_init                      ! ocean initial state (Dynamics and tracers) 
    316  
    317       IF( lk_dynspg_flt .OR. lk_dynspg_rl ) THEN 
    318          CALL solver_init( nit000 )         ! Elliptic solver 
    319       ENDIF 
    320  
    321 !!add 
    322                        CALL eos( tb, sb, rhd, rhop )        ! before potential and in situ densities 
    323                         
    324                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
    325  
    326       IF( lk_zps .AND. .NOT. lk_cfg_1d )   & 
    327          &             CALL zps_hde( nit000, tb, sb, rhd,  &  ! Partial steps: before Horizontal DErivative 
    328                                             gtu, gsu, gru, &  ! of t, s, rd at the bottom ocean level 
    329                                             gtv, gsv, grv ) 
    330  
    331 !!add 
    332  
    333       CALL oc_fz_pt                         ! Surface freezing point 
    334  
    335 #if defined key_ice_lim 
    336       CALL ice_init                         ! Sea ice model 
    337 #endif 
    338  
    339       !                                     ! Ocean scheme 
    340  
    341       CALL opa_flg                              ! Choice of algorithms 
    342  
    343       !                                     ! Ocean physics 
    344  
    345       CALL tra_qsr_init                         ! Solar radiation penetration 
    346  
    347       CALL ldf_dyn_init                         ! Lateral ocean momentum physics 
    348  
    349       CALL ldf_tra_init                         ! Lateral ocean tracer physics 
    350  
    351       CALL zdf_init                             ! Vertical ocean physics 
    352  
    353       !                                     ! Ocean trends 
    354       ! Control parameters  
    355       IF( lk_trdtra .OR. lk_trdmld )   l_trdtra = .TRUE. 
    356       IF( lk_trddyn .OR. lk_trdvor )   l_trddyn = .TRUE. 
    357  
    358       IF( lk_trddyn .OR. lk_trdtra )   & 
    359          &            CALL trd_icp_init         ! active tracers and/or momentum 
    360  
    361       IF( lk_trdmld ) CALL trd_mld_init         ! mixed layer 
    362  
    363       IF( lk_trdvor ) CALL trd_vor_init         ! vorticity 
    364  
    365 #if defined key_passivetrc 
    366       CALL ini_trc                           ! Passive tracers 
    367 #endif 
    368  
    369 #if defined key_coupled 
    370       itro  = nitend - nit000 + 1           ! Coupled 
    371       istp0 = NINT( rdt ) 
    372       CALL cpl_init( itro, nexco, istp0 )   ! Signal processing and process id exchange 
    373 #endif 
    374  
    375       CALL flx_init                         ! Thermohaline forcing initialization 
    376  
    377       CALL flx_fwb_init                     ! FreshWater Budget correction 
    378  
    379       CALL dia_ptr_init                     ! Poleward TRansports initialization 
    380  
    381       !                                     ! =============== ! 
    382       !                                     !  time stepping  ! 
    383       !                                     ! =============== ! 
    384  
    385       IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA 
    386  
    387       IF( lk_cfg_1d  )  THEN  
    388          CALL init_1d 
    389       ENDIF 
    390    END SUBROUTINE opa_init 
    391    !!====================================================================== 
    392386END MODULE opa 
Note: See TracChangeset for help on using the changeset viewer.