Ignore:
Timestamp:
07/26/12 04:05:44 (12 years ago)
Author:
dubos
Message:

Minor changes :
caldyn_sw.f90, advect_tracer.f90
icosa_mod.f90 : added parameters for NCAR test cases needing global scope
guided_mod.f90 : CALL to guided_ncar now takes tt=it*dt instead of it as input

Significant changes :
timeloop_gcm.f90 : re-activated CALL to advection scheme
disvert_ncar.f90,
etat0_ncar.f90
guided_ncar_mod.f90 : simplification, introduced several getin(...), update due to recent changes in advection test cases (deformational flow, Hadley cell)
run_adv.def : new keys, reorganized for legibility

Tests :
icosa_gcm.exe tested with ncar_adv_shape=const and ncar_adv_wind=solid,deform,hadley.
q1=1 maintained to machine accuracy. Surface pressure slightly oscillates as expected.

FIXME : Tests by Sarvesh with revision 24 show incorrect advection of cosine bell by solid-body rotation. Not fixed.

File:
1 edited

Legend:

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

    r19 r25  
    1919  REAL(rstd), PARAMETER :: rt=radius*0.5 
    2020  REAL(rstd), PARAMETER :: zc=5000.0 
    21   REAL(rstd), PARAMETER :: ps0=100000.0 
    22   REAL(rstd), PARAMETER :: T0=300 
    23   REAL(rstd), PARAMETER :: R_d=287.0    
    2421 
    2522  PUBLIC etat0 
     
    7875  REAL(rstd) :: X2(3),X1(3) 
    7976  INTEGER :: i,j,n,l 
    80   INTEGER :: testcase 
    81  
    82     u = 0.0 ; phis = 0 ; theta_rhodz = 0 ; ps = ps0 
    83          
    84     DO l=1, llm+1 
    85       pr = ap(l) + bp(l)*ps0 
    86       zr(l) = -R_d*T0/g*log(pr/ps0)  
    87     ENDDO     
    88  
    89     DO l=1, llm  
    90       zrl(l) = 0.5*(zr(l) + zr(l+1))  
    91     END DO 
    92  
    93     testcase=5 
    94     CALL getin('ncar_test_case',testcase) 
    95   
    96     SELECT CASE(testcase) 
    97 !--------------------------------------------- SINGLE COSINE BELL 
    98       CASE(0) 
    99         CALL cosine_bell_1(q)  
    100          
    101       CASE(1) 
    102         CALL cosine_bell_2(q)  
    103          
    104       CASE(2) 
    105         CALL cosine_bell_2(q)  
    106         DO l=1,llm 
    107           q(:,l)= 0.9 - 0.8*q(:,l)*q(:,l) 
    108         END DO   
    109          
    110       CASE(3) 
    111         CALL slotted_cylinders(q)        
    112  
    113       CASE(4)  
    114         CALL cosine_bell_2(qxt1) 
    115         DO l = 1,llm 
    116           q(:,l) = 0.9 - 0.8*qxt1(:,l)*qxt1(:,l)   
    117         END DO  
    118         q = q + qxt1  
    119         CALL slotted_cylinders(qxt1) 
    120         q = q + qxt1  
    121         q = 1. - q*0.3   
    122           
    123       CASE(5)  ! hadley like meridional circulation  
    124         CALL hadleyq(q)  
    125          
    126       CASE DEFAULT 
    127         PRINT*,"no such initial profile" 
    128         STOP 
    129          
    130       END SELECT 
    131   
    132   CONTAINS 
     77  CHARACTER(len=255) :: ncar_adv_shape 
     78 
     79  u = 0.0 ; phis = 0 ; theta_rhodz = 0 ; ps = ncar_p0 
     80   
     81  DO l=1, llm+1 
     82     pr = ap(l) + bp(l)*ncar_p0 
     83     zr(l) = -kappa*cpp*ncar_T0/g*log(pr/ncar_p0)  
     84  ENDDO 
     85   
     86  DO l=1, llm  
     87     zrl(l) = 0.5*(zr(l) + zr(l+1))  
     88  END DO 
     89   
     90  ncar_adv_shape='cos_bell' 
     91  CALL getin('ncar_adv_shape',ncar_adv_shape) 
     92   
     93  SELECT CASE(TRIM(ncar_adv_shape)) 
     94     !--------------------------------------------- SINGLE COSINE BELL 
     95  CASE('const') 
     96     q=1 
     97  CASE('cos_bell') 
     98     CALL cosine_bell_1(q)  
     99      
     100  CASE('slotted_cyl') 
     101     CALL slotted_cylinders(q)   
     102      
     103  CASE('dbl_cos_bell_q1') 
     104     CALL cosine_bell_2(q)  
     105      
     106  CASE('dbl_cos_bell_q2') 
     107     CALL cosine_bell_2(q)  
     108     DO l=1,llm 
     109        q(:,l)= 0.9 - 0.8*q(:,l)*q(:,l) 
     110     END DO 
     111      
     112  CASE('complement') 
     113     ! tracer such that, in combination with the other tracer fields  
     114     ! with weight (3/10), the sum is equal to one 
     115     CALL cosine_bell_2(qxt1) 
     116     DO l = 1,llm 
     117        q(:,l) = 0.9 - 0.8*qxt1(:,l)*qxt1(:,l)   
     118     END DO 
     119     q = q + qxt1  
     120     CALL slotted_cylinders(qxt1) 
     121     q = q + qxt1  
     122     q = 1. - q*0.3   
     123      
     124  CASE('hadley')  ! hadley like meridional circulation  
     125     CALL hadleyq(q)  
     126      
     127  CASE DEFAULT 
     128     PRINT *, 'Bad selector for variable ncar_adv_shape : <', TRIM(ncar_adv_shape),   & 
     129          '> options are <const>, <slotted_cyl>, <cos_bell>, <dbl_cos_bell_q1>', & 
     130          '<dbl_cos_bell_q2>, <complement>, <hadley>' 
     131     STOP 
     132      
     133  END SELECT 
     134       
     135CONTAINS 
    133136 
    134137!====================================================================== 
Note: See TracChangeset for help on using the changeset viewer.