Changeset 72


Ignore:
Timestamp:
08/02/12 20:44:58 (12 years ago)
Author:
dubos
Message:

Improved etat0_dcmip1.f90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/trunk/src/etat0_dcmip1.f90

    r55 r72  
    3838    REAL(rstd),POINTER :: u(:,:) 
    3939    REAL(rstd),POINTER :: q(:,:,:) 
     40    CHARACTER(len=255) :: dcmip1_adv_shape 
    4041    INTEGER :: ind 
    4142     
    4243    R0=radius*0.5 
    4344    rt=radius*0.5 
     45    dcmip1_adv_shape='cos_bell' 
     46    CALL getin('dcmip1_shape',dcmip1_adv_shape) 
    4447     
    4548    DO ind=1,ndomain 
     
    5154      u=f_u(ind) 
    5255      q=f_q(ind) 
    53       CALL compute_etat0_ncar(ps, phis, theta_rhodz, u, q(:,:,1)) 
     56 
     57 
     58      SELECT CASE(TRIM(dcmip1_adv_shape)) 
     59      CASE('const') 
     60         CALL compute_etat0_ncar(1,ps, phis, theta_rhodz, u, q(:,:,1)) 
     61      CASE('cos_bell') 
     62         CALL compute_etat0_ncar(2,ps, phis, theta_rhodz, u, q(:,:,1)) 
     63      CASE('slotted_cyl') 
     64         CALL compute_etat0_ncar(3,ps, phis, theta_rhodz, u, q(:,:,1)) 
     65      CASE('dbl_cos_bell_q1') 
     66         CALL compute_etat0_ncar(4,ps, phis, theta_rhodz, u, q(:,:,1)) 
     67      CASE('dbl_cos_bell_q2') 
     68         CALL compute_etat0_ncar(5,ps, phis, theta_rhodz, u, q(:,:,1)) 
     69      CASE('complement') 
     70         CALL compute_etat0_ncar(6,ps, phis, theta_rhodz, u, q(:,:,1)) 
     71      CASE('hadley')  ! hadley like meridional circulation  
     72         CALL compute_etat0_ncar(7,ps, phis, theta_rhodz, u, q(:,:,1)) 
     73      CASE('dcmip11') 
     74         IF(nqtot==5) THEN 
     75            CALL compute_etat0_ncar(4,ps, phis, theta_rhodz, u, q(:,:,1)) 
     76            CALL compute_etat0_ncar(5,ps, phis, theta_rhodz, u, q(:,:,2)) 
     77            CALL compute_etat0_ncar(3,ps, phis, theta_rhodz, u, q(:,:,3)) 
     78            CALL compute_etat0_ncar(6,ps, phis, theta_rhodz, u, q(:,:,4)) 
     79            CALL compute_etat0_ncar(1,ps, phis, theta_rhodz, u, q(:,:,5)) 
     80         ELSE 
     81            PRINT *,'Error : etat0_dcmip=dcmip11 and nqtot = ',nqtot,' .' 
     82            PRINT *,'nqtot must be equal to 5 when etat0_dcmip=dcmip11' 
     83            STOP 
     84         END IF 
     85      CASE DEFAULT 
     86         PRINT *, 'Bad selector for variable dcmip1_adv_shape : <', TRIM(dcmip1_adv_shape),   & 
     87              '> options are <const>, <slotted_cyl>, <cos_bell>, <dbl_cos_bell_q1>', & 
     88              '<dbl_cos_bell_q2>, <complement>, <hadley>' 
     89         STOP 
     90      END SELECT 
     91 
    5492    ENDDO 
    5593 
    5694  END SUBROUTINE etat0 
    5795   
    58   SUBROUTINE compute_etat0_ncar(ps, phis, theta_rhodz, u, q) 
     96  SUBROUTINE compute_etat0_ncar(icase, ps, phis, theta_rhodz, u, q) 
    5997  USE icosa 
    6098  USE disvert_mod 
     
    64102  USE theta2theta_rhodz_mod 
    65103  IMPLICIT NONE   
     104  INTEGER, INTENT(in) :: icase 
    66105  REAL(rstd),INTENT(OUT) :: ps(iim*jjm) 
    67106  REAL(rstd),INTENT(OUT) :: phis(iim*jjm) 
     
    69108  REAL(rstd),INTENT(OUT) :: u(3*iim*jjm,llm) 
    70109  REAL(rstd),INTENT(OUT) :: q(iim*jjm,llm)   
    71  
    72110 
    73111  REAL(rstd) :: qxt1(iim*jjm,llm) 
     
    78116  REAL(rstd) :: X2(3),X1(3) 
    79117  INTEGER :: i,j,n,l 
    80   CHARACTER(len=255) :: ncar_adv_shape 
    81118 
    82119  u = 0.0 ; phis = 0 ; theta_rhodz = 0 ; ps = ncar_p0 
     
    91128  END DO 
    92129   
    93   ncar_adv_shape='cos_bell' 
    94   CALL getin('ncar_adv_shape',ncar_adv_shape) 
    95    
    96   SELECT CASE(TRIM(ncar_adv_shape)) 
     130  SELECT CASE(icase) 
     131  CASE(1) 
     132     q=1 
     133  CASE(2) 
    97134     !--------------------------------------------- SINGLE COSINE BELL 
    98   CASE('const') 
    99      q=1 
    100   CASE('cos_bell') 
    101      CALL cosine_bell_1(q)  
    102       
    103   CASE('slotted_cyl') 
     135     CALL cosine_bell_1(q)       
     136  CASE(3) 
    104137     CALL slotted_cylinders(q)   
    105       
    106   CASE('dbl_cos_bell_q1') 
    107      CALL cosine_bell_2(q)  
    108       
    109   CASE('dbl_cos_bell_q2') 
     138  CASE(4) 
     139     PRINT *, 'Double cosine bell' 
     140     CALL cosine_bell_2(q)       
     141  CASE(5) 
    110142     CALL cosine_bell_2(q)  
    111143     DO l=1,llm 
    112144        q(:,l)= 0.9 - 0.8*q(:,l)*q(:,l) 
    113      END DO 
    114       
    115   CASE('complement') 
     145     END DO      
     146  CASE(6) 
    116147     ! tracer such that, in combination with the other tracer fields  
    117148     ! with weight (3/10), the sum is equal to one 
     
    123154     CALL slotted_cylinders(qxt1) 
    124155     q = q + qxt1  
    125      q = 1. - q*0.3   
    126       
    127   CASE('hadley')  ! hadley like meridional circulation  
     156     q = 1. - q*0.3 
     157  CASE(7)  ! hadley like meridional circulation  
    128158     CALL hadleyq(q)  
    129       
    130   CASE DEFAULT 
    131      PRINT *, 'Bad selector for variable ncar_adv_shape : <', TRIM(ncar_adv_shape),   & 
    132           '> options are <const>, <slotted_cyl>, <cos_bell>, <dbl_cos_bell_q1>', & 
    133           '<dbl_cos_bell_q2>, <complement>, <hadley>' 
    134      STOP 
    135       
    136159  END SELECT 
    137160       
     
    228251            IF ( zrl(l) .GT. zc ) Then  
    229252              IF ( ABS(latc1 - lat) .LT. 0.125 ) Then  
    230                 hx(n,l)= 0.0 
     253                hx(n,l)= 0.1 
    231254              ENDIF  
    232255            ENDIF   
Note: See TracChangeset for help on using the changeset viewer.