Changeset 797 for codes


Ignore:
Timestamp:
01/10/19 17:37:58 (5 years ago)
Author:
jisesh
Message:

unstructured/Python : command-line arg for ztop in Baroclinic_3D_ullrich.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/test/py/Baroclinic_3D_ullrich.py

    r795 r797  
    1818getargs.add("--kappa_divgrad",  type=float, default=3.0e15) 
    1919getargs.add("--kappa_curlcurl", type=float, default=3.0e15) 
     20getargs.add("--ztop", type=float, default=30000.) 
    2021 
    2122getargs.defaults(dt=360., llm=50) 
     
    5455    return pmesh 
    5556 
    56 def baroclinic_3D(pmesh, Lx,Ly,llm,ztop=25000.): 
     57def baroclinic_3D(pmesh, Lx,Ly,llm,ztop): 
    5758    Rd    = 287.0      # Gas constant for dryy air (j kg^-1 K^-1) 
    5859    T0    = 288.0      # Reference temperature (K)  
     
    6162    u0    = 35.        # Reference zonal wind speed (m s^-1) 
    6263    a     = 6.371229e6 # Radius of the Earth (m) 
    63     ptop  = 2000. 
    6464    y0    = .5*Ly 
    6565    Cpd   = 1004.5 
     
    104104    y_ek, alpha_ek = np.meshgrid(mesh.lat_e+y0, alpha_k, indexing='ij') 
    105105 
    106     print('ztop(ptop) according to Eq. 7:', T0/lap*(1.-(ptop/p0)**(Rd*lap/g)))  
    107106    print(np.shape(alpha_k),np.shape(alpha_l)) 
    108107    thermo = dyn.Ideal_perfect(Cpd, Rd, p0, T0) 
     
    130129    ptop = p(eta(1.)) 
    131130    print( 'ptop (Pa) = ', gas.p[0,-1], ptop) 
     131    print('ztop(ptop) according to Eq. 7:', T0/lap*(1.-(ptop/p0)**(Rd*lap/g)))  
    132132 
    133133    params=dyn.Struct() 
     
    190190     
    191191    pmesh = create_pmesh(nx,ny) 
    192     thermo, mesh, params, flow0, gas0 = baroclinic_3D(pmesh, Lx,Ly,llm) 
     192    thermo, mesh, params, flow0, gas0 = baroclinic_3D(pmesh, Lx,Ly,llm, args.ztop) 
    193193 
    194194    mass_bl,mass_dak,mass_dbk = meshes.compute_hybrid_coefs(flow0[0]) 
Note: See TracChangeset for help on using the changeset viewer.