Skip to content

Commit

Permalink
Merge branch 'master' of github.com:iurnus/scripps_kaust_model
Browse files Browse the repository at this point in the history
  • Loading branch information
iurnus committed Jul 27, 2019
2 parents 1468739 + 61f0c66 commit b9f8a2b
Show file tree
Hide file tree
Showing 22 changed files with 525 additions and 15 deletions.
2 changes: 2 additions & 0 deletions coupler/L3.C1.coupled_RS2012_ring/README.install
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ The MITgcm source file should be in '../../MITgcm_c66h/' to run this case.
The ESMF should be installed in '../../esmf/' to run this case.
The WRF v3.9.1.1 with should be installed in '../../WRFV3911_AO/' to run this case.
In install.sh, the MPI_HOME variable is "/project_shared/Libraries/openmpi-2.1.1_pgi_fortran_17.5-0/include"
Make sure MATLAB is installed.
Make sure NCL is installed.
8 changes: 6 additions & 2 deletions coupler/L3.C1.coupled_RS2012_ring/allrun.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/csh -f

./install.sh
./install_mit.sh
# ./install.sh
# ./install_mit.sh

cd runCase.init/
./Allrun
cd ..

cd runCase/
./Allrun
Expand Down
1 change: 1 addition & 0 deletions coupler/L3.C1.coupled_RS2012_ring/runCase.init/Allrun
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# cp /home/rus043/kaust_project/codeNew/regionalCOAM/coupler/coupler_redsea_verification/save_nc/2012_medium/met_em.d01.2012-06-0[1-2]*.nc .
# cp ../../../WPS_RedSea/met_em*nc .

ln -sf ../save_nc/* .
ln -sf ../caseInput/* .
cp ../../../WRFV3911_AO/main/real.exe .
cp ../../../WRFV3911_AO/main/wrf.exe .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
e_sn = 129, 97, 91,
e_vert = 41, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 138,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 17371.48, 10000, 3333.33,
dy = 17371.48, 10000, 3333.33,
Expand Down
2 changes: 1 addition & 1 deletion coupler/L3.C1.coupled_RS2012_ring/runCase/namelist.input
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
e_sn = 129, 97, 91,
e_vert = 41, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 138,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 17371.48, 10000, 3333.33,
dy = 17371.48, 10000, 3333.33,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
e_sn = 129, 97, 91,
e_vert = 41, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 138,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 17371.48, 10000, 3333.33,
dy = 17371.48, 10000, 3333.33,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
e_sn = 129, 97, 91,
e_vert = 41, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 138,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 17371.48, 10000, 3333.33,
dy = 17371.48, 10000, 3333.33,
Expand Down
3 changes: 2 additions & 1 deletion coupler/L3.C1.coupled_RS2012_ring/runWRFtest/Allclean
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ rm -rf *.TBL
rm -rf RRTM*
rm -rf wrf*d01
rm -rf CAM*
rm -rf cplFlux
rm -rf cplFlux*
rm -rf ozone*
rm -rf log*
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
e_sn = 129, 97, 91,
e_vert = 41, 30, 30,
p_top_requested = 5000,
num_metgrid_levels = 138,
num_metgrid_levels = 27,
num_metgrid_soil_levels = 4,
dx = 17371.48, 10000, 3333.33,
dy = 17371.48, 10000, 3333.33,
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 3 additions & 0 deletions coupler/L3.C2.coupled_CA2018_ring/README.install
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ The MITgcm source file should be in '../../MITgcm_c66h/' to run this case.
The ESMF should be installed in '../../esmf/' to run this case.
The WRF v3.9.1.1 with should be installed in '../../WRFV3911_AO/' to run this case.
In install.sh, the MPI_HOME variable is "/opt/openmpi/intel/ib/include/"
Mast have MATLAB
The WRF nc files are too large and are not saved in the git repository.

23 changes: 23 additions & 0 deletions coupler/L3.C2.coupled_CA2018_ring/allclean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/csh -f

./clean.sh

cd runCase/
./Allclean
cd ..

cd runCase.init/
./Allclean
cd ..

cd runMITtest/
./Allclean
cd ..

cd runWRFtest/
./Allclean
cd ..

cd latexSummary
./clean.sh
cd ..
26 changes: 26 additions & 0 deletions coupler/L3.C2.coupled_CA2018_ring/allrun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/csh -f

# ./install.sh
# ./install_mit.sh

cd runCase.init/
./Allrun
cd ..

cd runCase/
./Allrun
cd ..

cd runMITtest/
./Allrun
cd ..

cd runWRFtest/
./Allrun
cd ..

cd latexSummary
./generate.sh
cd ..

evince latexSummary/report.pdf
9 changes: 5 additions & 4 deletions coupler/L3.C2.coupled_CA2018_ring/runCase.init/Allrun
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash

export CPL_FOLDER='/project/rus043_data/ar_2018_forecast/'
ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-01-2[6-9]*.nc .
ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-01-3[0-9]*.nc .
ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-02-0[1-2]*.nc .
# export CPL_FOLDER='/project/rus043_data/ar_2018_forecast/'
# ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-01-2[6-9]*.nc .
# ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-01-3[0-9]*.nc .
# ln -s ${CPL_FOLDER}/save_nc/fine_loop_3911/2018_0127/met_em.d01.2018-02-0[1-2]*.nc .
cp ../save_nc/*.nc .
cp ../caseInput/* .
cp ../../../WRFV3911_AO/main/real.exe .
cp ../../../WRFV3911_AO/main/wrf.exe .
Expand Down
6 changes: 3 additions & 3 deletions coupler/L3.C2.coupled_CA2018_ring/runCase/namelist.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ StartMinute: 00
StartSecond: 00

StopYear: 2018
StopMonth: 02
StopDay: 01
StopHour: 00
StopMonth: 01
StopDay: 27
StopHour: 03
StopMinute: 00
StopSecond: 00

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
clear all
close all
clc

wrf_results = '../../runCase/wrfout_d01_2018-01-27_00:00:00';
opath = './';
fpath = opath;

eval ([ 'load ' fpath 'FMT.mat']);

ctl = {'T2','Q2','LH','HFX','U10','V10'};
ctl_i = {'atemp','aqh','hl','hs','uwind','vwind',};

prec='double';

np = length(ctl);
saveField = {};
for jp = 1:np
jp
param_wrf = [ctl{jp}];
param_out = [ctl_i{jp}];

file = wrf_results;

ncid = netcdf.open(file,'NOWRITE');
[numdims, numvars, numglobalatts, unlimdimID] = netcdf.inq(ncid);

for varid =1:numvars
varlist(varid) = {netcdf.inqVar(ncid,varid-1)};
end

ind=find(ismember(varlist,param_wrf));
tmp = netcdf.getVar(ncid,ind-1,prec);

[varname vartype vardimIDs varatts] = netcdf.inqVar(ncid,ind-1);

for varatid =1:varatts
attlist(varatid) = {netcdf.inqAttName(ncid,ind-1,varatid-1)};
end

% miss = netcdf.getAtt(ncid,ind-1,'missing_value',prec)
% if miss < 0
% tmp(tmp <= miss) = NaN;
% else
% tmp(tmp >= miss) = NaN;
% end

if isempty(find(ismember(attlist,'scale_factor')))
scale = 1.0;
else
scale = netcdf.getAtt(ncid,ind-1,'scale_factor',prec);
end

if isempty(find(ismember(attlist,'add_offset')))
offset = 0.0;
else
offset = netcdf.getAtt(ncid,ind-1,'add_offset',prec);
end

tmp = offset + (tmp.*scale);

if (strcmp(param_wrf,'T2'))
% tmp = tmp - 273.15;
tmp = tmp;
elseif (strcmp(param_wrf,'LH'))
tmp = -tmp;
elseif (strcmp(param_wrf,'HFX'))
tmp = -tmp;
end

%% we need to flip as NCEPlat is flipped
% tmp = flipdim(tmp,2);
size(tmp)
wrslice([opath 'wrf_' param_out '_20mins_2018' ],tmp,1,fmt,Ieee);
netcdf.close(ncid);

saveField{jp} = tmp;

clear p param_* tmp dpath
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
clear all
close all
clc

wrf_results = '../../runCase/wrfout_d01_2018-01-27_00:00:00';
opath = './';
fpath = opath;

eval ([ 'load ' fpath 'FMT.mat']);

ctl = {'SFCEVP'}

prec='double';
deltaT = 60.0;

np = length(ctl);
tmpFields = {};
for jp = 1:np
jp
param_wrf = [ctl{jp}];

file = wrf_results;

ncid = netcdf.open(file,'NOWRITE');
[numdims, numvars, numglobalatts, unlimdimID] = netcdf.inq(ncid);

for varid =1:numvars
varlist(varid) = {netcdf.inqVar(ncid,varid-1)};
end

ind=find(ismember(varlist,param_wrf));
tmp = netcdf.getVar(ncid,ind-1,prec);

[varname vartype vardimIDs varatts] = netcdf.inqVar(ncid,ind-1);

for varatid =1:varatts
attlist(varatid) = {netcdf.inqAttName(ncid,ind-1,varatid-1)};
end

% miss = netcdf.getAtt(ncid,ind-1,'missing_value',prec)
% if miss < 0
% tmp(tmp <= miss) = NaN;
% else
% tmp(tmp >= miss) = NaN;
% end

if isempty(find(ismember(attlist,'scale_factor')))
scale = 1.0;
else
scale = netcdf.getAtt(ncid,ind-1,'scale_factor',prec);
end

if isempty(find(ismember(attlist,'add_offset')))
offset = 0.0;
else
offset = netcdf.getAtt(ncid,ind-1,'add_offset',prec);
end

tmp = offset + (tmp.*scale);

tmpFields{jp} = tmp;

clear p param_* tmp dpath
end

tmp_total = tmpFields{1};
tmp = tmp_total;

nTime = length(tmp(1,1,:));
for nT = 1:nTime-1
tmp(:,:,nT+1) = (tmp_total(:,:,nT+1)-tmp_total(:,:,nT))/deltaT/1000.0;
end

%% we need to flip as NCEPlat is flipped
% tmp = flipdim(tmp,2);
size(tmp)
wrslice([opath 'wrf_evap_20mins_2018' ],tmp,1,fmt,Ieee);
netcdf.close(ncid);
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
clear all
close all
clc

wrf_results = '../../runCase/wrfout_d01_2018-01-27_00:00:00';
opath = './';
fpath = opath;

eval ([ 'load ' fpath 'FMT.mat']);

ctl = {'LWDNB','LWUPB'}

prec='double';

np = length(ctl);
tmpFields = {};
for jp = 1:np
jp
param_wrf = [ctl{jp}];

file = wrf_results;

ncid = netcdf.open(file,'NOWRITE');
[numdims, numvars, numglobalatts, unlimdimID] = netcdf.inq(ncid);

for varid =1:numvars
varlist(varid) = {netcdf.inqVar(ncid,varid-1)};
end

ind=find(ismember(varlist,param_wrf));
tmp = netcdf.getVar(ncid,ind-1,prec);

[varname vartype vardimIDs varatts] = netcdf.inqVar(ncid,ind-1);

for varatid =1:varatts
attlist(varatid) = {netcdf.inqAttName(ncid,ind-1,varatid-1)};
end

% miss = netcdf.getAtt(ncid,ind-1,'missing_value',prec)
% if miss < 0
% tmp(tmp <= miss) = NaN;
% else
% tmp(tmp >= miss) = NaN;
% end

if isempty(find(ismember(attlist,'scale_factor')))
scale = 1.0;
else
scale = netcdf.getAtt(ncid,ind-1,'scale_factor',prec);
end

if isempty(find(ismember(attlist,'add_offset')))
offset = 0.0;
else
offset = netcdf.getAtt(ncid,ind-1,'add_offset',prec);
end

tmp = offset + (tmp.*scale);

tmpFields{jp} = tmp;

clear p param_* tmp dpath
end

tmp = tmpFields{2} - tmpFields{1};

%% we need to flip as NCEPlat is flipped
% tmp = flipdim(tmp,2);
size(tmp);
wrslice([opath 'wrf_lwflux_20mins_2018' ],tmp,1,fmt,Ieee);
netcdf.close(ncid);
Loading

0 comments on commit b9f8a2b

Please sign in to comment.