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 2715 for trunk/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90 – NEMO

Ignore:
Timestamp:
2011-03-30T17:58:35+02:00 (13 years ago)
Author:
rblod
Message:

First attempt to put dynamic allocation on the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/LBC/cla.F90

    r2442 r2715  
    3131   USE lib_mpp        ! distributed memory computing library 
    3232   USE lbclnk         ! ocean lateral boundary conditions (or mpp link) 
     33   USE lib_mpp        ! MPP library 
    3334 
    3435   IMPLICIT NONE 
     
    4344   !                                ! for Bab-el-Mandeb, Gibraltar, and Hormuz straits 
    4445    
    45    !                                                              !!! profile of hdiv for some straits 
    46    REAL(wp), DIMENSION (jpk) ::   hdiv_139_101, hdiv_139_101_kt    ! Gibraltar     strait, fixed & time evolving part (i,j)=(172,101) 
    47    REAL(wp), DIMENSION (jpk) ::   hdiv_139_102                     ! Gibraltar     strait, fixed part only            (i,j)=(139,102) 
    48    REAL(wp), DIMENSION (jpk) ::   hdiv_141_102, hdiv_141_102_kt    ! Gibraltar     strait, fixed & time evolving part (i,j)=(141,102) 
    49    REAL(wp), DIMENSION (jpk) ::   hdiv_161_88 , hdiv_161_88_kt     ! Bab-el-Mandeb strait, fixed & time evolving part (i,j)=(161,88) 
    50    REAL(wp), DIMENSION (jpk) ::   hdiv_161_87                      ! Bab-el-Mandeb strait, fixed part only            (i,j)=(161,87) 
    51    REAL(wp), DIMENSION (jpk) ::   hdiv_160_89 , hdiv_160_89_kt     ! Bab-el-Mandeb strait, fixed & time evolving part (i,j)=(160,89) 
    52    REAL(wp), DIMENSION (jpk) ::   hdiv_172_94                      ! Hormuz        strait, fixed part only            (i,j)=(172, 94) 
    53  
    54    REAL(wp), DIMENSION (jpk) ::   t_171_94_hor, s_171_94_hor       ! Temperature, salinity in the Hormuz strait 
     46   !                                           !   fixed part  !  time evolving    !!! profile of hdiv for some straits 
     47   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_139_101, hdiv_139_101_kt    ! Gibraltar    (i,j)=(172,101) 
     48   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_139_102                     ! Gibraltar     (i,j)=(139,102) 
     49   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_141_102, hdiv_141_102_kt    ! Gibraltar    (i,j)=(141,102) 
     50   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_161_88 , hdiv_161_88_kt     ! Bab-el-Mandeb (i,j)=(161,88) 
     51   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_161_87                      ! Bab-el-Mandeb (i,j)=(161,87) 
     52   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_160_89 , hdiv_160_89_kt     ! Bab-el-Mandeb (i,j)=(160,89) 
     53   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   hdiv_172_94                      ! Hormuz        (i,j)=(172, 94) 
     54 
     55   REAL(wp), ALLOCATABLE, SAVE, DIMENSION (:) ::   t_171_94_hor, s_171_94_hor       ! Temperature, salinity in Hormuz strait 
    5556    
    5657   !! * Substitutions 
     
    177178      !! ** Action  :   nbab, ngib, nhor   strait inside the local domain or not 
    178179      !!--------------------------------------------------------------------- 
    179       REAL(wp) ::   ztemp 
     180      REAL(wp) ::   ztemp   ! local scalar 
     181      INTEGER  ::   ierr    ! local integer 
    180182      !!--------------------------------------------------------------------- 
    181183      ! 
     
    184186      IF(lwp) WRITE(numout,*) '~~~~~~~~~' 
    185187      ! 
     188      !                           ! Allocate arrays for this module 
     189      ALLOCATE( hdiv_139_101(jpk) , hdiv_139_101_kt(jpk) ,     &    ! Gibraltar 
     190         &      hdiv_139_102(jpk) ,                            & 
     191         &      hdiv_141_102(jpk) , hdiv_141_102_kt(jpk) ,     & 
     192         &      hdiv_161_88 (jpk) , hdiv_161_88_kt (jpk) ,     &    ! Bab-el-Mandeb 
     193         &      hdiv_161_87 (jpk) ,                            &                      
     194         &      hdiv_160_89 (jpk) , hdiv_160_89_kt (jpk) ,     &     ! Hormuz 
     195         &      hdiv_172_94 (jpk) ,                            & 
     196         &      t_171_94_hor(jpk) , s_171_94_hor   (jpk) , STAT=ierr ) 
     197      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
     198      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'cla_init: unable to allocate arrays' ) 
     199      ! 
    186200      IF( .NOT.lk_dynspg_flt )   CALL ctl_stop( 'cla_init: Cross Land Advection works only with lk_dynspg_flt=T ' ) 
    187201      ! 
    188       IF( lk_vvl    )   CALL ctl_stop( 'cla_init: Cross Land Advection does not work with lk_vvl=T option' ) 
    189       ! 
    190       IF( jpk /= 31 )   CALL ctl_stop( 'cla_init: Cross Land Advection hard coded for ORCA_R2_L31' ) 
     202      IF( lk_vvl             )   CALL ctl_stop( 'cla_init: Cross Land Advection does not work with lk_vvl=T option' ) 
     203      ! 
     204      IF( jpk /= 31          )   CALL ctl_stop( 'cla_init: Cross Land Advection hard coded for ORCA_R2_L31' ) 
    191205      ! 
    192206      !                                        _|_______|_______|_ 
     
    723737   !!   Default key                                            Dummy module 
    724738   !!---------------------------------------------------------------------- 
    725    USE in_out_manager ! I/O manager 
     739   USE lib_mpp, ONLY:   ctl_stop 
    726740CONTAINS 
    727741   SUBROUTINE cla_init 
Note: See TracChangeset for help on using the changeset viewer.