source: src/htune_test_plot.R @ 158

Last change on this file since 158 was 101, checked in by htune, 7 years ago

New syntax for csv metrics
Fredho

##############################################################################
# Computing metrics from LES and SCM
# Result in csv format
# Auteur: F Couvreux, R Honnert, F Hourdin, N Villefranque, C Rio, n'co
##############################################################################
#
# metrics are specified in list_case
# metrics names follow the syntax
#
# CASE_SUBCASE_METRICS_T1_T2
# T1 and T2 are initial and final time step for time averages
#
# available METRICS :
# ===================
#
# 1/ zav-400-600-var -> variable "var" averaged between 400 and 600 m
#
# 2/ Ay-var -> integral ( min ( var -var(t=0) ) dz ) / integral ( dz )
# integral taken from 0 to zmax
#
# 3/ nebzave, neb2zave, neb4zave : Effective cloud height
# = int ( nebp z dz ) / int ( nebp dz ) with p=1, 2 or 4
#
# 4/ nebmax : maximum cloud fraction on the column
#
# 5/ nebzmin, nebzmax : minimum/maximum cloud height
#
# 6/ lwp : liquid water path
#
# TBD :
# =====
# 1/ integrals are computed assuming rho=1 because rho is not systematically avalble
# 2/ the time average is coded for zav metrics only
#
##############################################################################

File size: 1.2 KB
Line 
1###############################################################################
2# Auteurs : Najda Villefranque
3# Modif 2017/12/15 : F. Hourdin
4# Reads z-t files from LES and SCM stored in DATA/
5#    SMC001.nc, SCM002.nc, ... and same for LES
6# tout_tracer plots vertical profiles of a variable N at time 
7###############################################################################
8
9library("ncdf4") # to manipulate ncdf
10
11WAVEN=1
12case_name="bomex"
13plotvar="rneb"
14itest=2
15
16source('ModelParam.R')
17source('htune_plot.R')
18source('htune_case_setup.R')
19source('htune_metric.R')
20casesu <-case_setup(case_name)
21NLES=casesu[1]
22TimeLES=casesu[2]
23TimeSCM=casesu[3]
24NRUNS=NSCMS
25nparam=NPARA
26
27if ( itest == 0 ) {
28  file="LES/arm_cu/LES0.nc"
29  nc =  nc_open(file)
30  var = ncvar_get(nc,"rneb")
31  zval = ncvar_get(nc,"zf")
32  nebzmax<-compute_zhneb(zval,var,zmax,"nebzmax")
33  nebzmin<-compute_zhneb(zval,var,zmax,"nebzmin")
34  nebzave<-compute_zhneb(zval,var,zmax,"nebzave")
35  plot(nebzmax,type="l")
36  lines(nebzmin,col="red")
37  lines(nebzave,col="blue")
38} else if ( itest == 1 ) {
39  trace_serie_s(case_name,"nebzmax")
40} else if ( itest == 2 ) {
41  pltsu<-plot_setup(case_name,plotvar)
42  tout_tracer(plotvar,case_name,TimeSCM,TimeLES)
43}
Note: See TracBrowser for help on using the repository browser.