Changeset 727 for configs


Ignore:
Timestamp:
08/22/18 17:30:37 (6 years ago)
Author:
dubos
Message:

testing : compare output to reference outputs

Location:
configs/testing
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • configs/testing/bash/build.sh

    r702 r727  
    1717 
    1818    LOGFILE=$ROOT/logs/build_xios.log 
    19     cd $ROOT/XIOS 
     19    cd -P $ROOT/XIOS 
    2020    echo "In $PWD : Building XIOS" 
    2121    echo "./make_xios --arch $arch $other_XIOS --job $job" 
  • configs/testing/bash/create_runs.sh

    r716 r727  
    1111    mkdir $EXPDIR 
    1212    cd $EXPDIR 
     13    ln -sf ../../RUNS_ref/$EXPDIR/netcdf netcdf_ref 
    1314    ln -sf $ROOT/build_${EXEC} build 
    1415    ln -sf build/bin/icosa_gcm.exe gcm.exe 
     
    219220# DCMIP 2012 
    220221    create_exp mpi DCMIP21 two_degree 100s 40 90000 # nbp tau  
    221     create_exp mpi DCMIP31 two_degree 60s 40 90000 .FALSE. # nbp tau hydro 
    222     create_exp mpi_omp DCMIP31 two_degree 60s 40 90000 .TRUE. # nbp tau hydro  
     222    create_exp mpi DCMIP31 two_degree 60s 40 90000 .TRUE. # nbp tau hydro 
     223    create_exp mpi_omp DCMIP31 two_degree 60s 40 90000 .FALSE. # nbp tau hydro  
    223224    create_exp mpi_omp DCMIP41 two_degree 24h 40 10000 # nbp tau  
    224225#    create_exp mpi DCMIP51 one_degree 2h  80 10000 # nbp tau  
  • configs/testing/python/common.py

    r520 r727  
    4444        #        plt.yticks(np.arange(0, 10001, 1000)) 
    4545        plt.savefig('%s.png'%varname) 
     46        plt.close() 
    4647    lon, lat, Omega,T,u,Phi = getvars(nc, 'lon','lat','OMEGA', 'T', 'U', 'PHI') 
    4748    plot_var(nlon,nlat,llm, lon,Phi,Omega,'Omega') 
     
    6465        axis_latitude() 
    6566        plt.savefig('T850.png') 
     67        plt.close() 
    6668         
    67     def plot_dT(nlon,nlat,llm, lon,T,p,Phi): # perturbation temp, final time 
     69    def plot_dT(nlon,nlat,llm, lon,T_ref,T,p,Phi): # perturbation temp, final time 
    6870        # vertical slice at final time 
    6971        print 'Reading data ...' 
    70         T,p, Phi = T[-1,:,nlat/2,:], p[-1,:,nlat/2,:], Phi[-1,:,nlat/2,:] 
     72        T_ref,T,p,Phi = [ x[-1,:,nlat/2,:] for x in T_ref,T,p,Phi] 
    7173        print '... done.' 
    7274        N, Teq, peq = 0.01, 300., 1e5 
     
    8587        plt.yticks(np.arange(0, 10001, 1000)) 
    8688        plt.savefig('dT.png') 
     89        plt.close() 
     90 
     91        plt.figure(figsize=(12,6)) 
     92        plt.contourf(lon2,z,T-T_ref) 
     93        plt.colorbar()  
     94        plt.title('$T-T_{ref}$') 
     95        axis_longitude() 
     96        plt.ylabel('z (m)') 
     97        plt.yticks(np.arange(0, 10001, 1000)) 
     98        plt.savefig('dT_ref.png') 
     99        plt.close() 
    87100 
    88101    lon, lat, T850, T, Phi, p = getvars(nc, 'lon','lat','T850', 'T', 'PHI','P') 
    89     plot_dT(nlon,nlat,llm, lon,T,p,Phi) 
     102    T_ref, = getvars(nc_ref, 'T') 
     103    plot_dT(nlon,nlat,llm, lon,T_ref,T,p,Phi) 
     104#    plot_dT_ref(nlon,nlat,llm, lon,T_ref,T,p,Phi) 
    90105    plot_T850(lon,lat,T850) 
    91106 
     
    116131#--------------------------- MAIN ---------------------------- 
    117132 
    118 gridfile = 'netcdf/output_dcmip2016_regular.nc' 
    119 nc = cdf.Dataset(gridfile, "r") 
     133filename = 'output_dcmip2016_regular.nc' 
     134nc = cdf.Dataset('netcdf/%s'%filename, "r") 
     135nc_ref = cdf.Dataset('netcdf_ref/%s'%filename, "r") 
     136 
    120137llm, nlon, nlat, ntime = getdims(nc, 'lev','lon','lat','time_counter') 
    121138Cpd, kappa, g = 1004.5, 0.2857143, 9.80616 
Note: See TracChangeset for help on using the changeset viewer.