MATLAB & Practical Application on Climate Variability Studies EXERCISES

Similar documents
MATLAB & Practical Applications on Climate Variability Studies tutorial

MATLAB & Practical Application on Climate Variability Studies EXERCISES

MATLAB & Practical Application on Climate Variability Studies EXERCISES

ITACS : Interactive Tool for Analysis of the Climate System

Exercises with Level-2 satellite data

There is also a more in-depth GUI called the Curve Fitting Toolbox. To run this toolbox, type the command

3 Selecting the standard map and area of interest

Exercises with Level-2 satellite data

WRF-NMM Standard Initialization (SI) Matthew Pyle 8 August 2006

NCL variable based on a netcdf variable model

Ocean Simulations using MPAS-Ocean

2 Assembling a consistent time series of sea ice data

Lab: Scientific Computing Tsunami-Simulation

In this exercise, you ll create a netcdf raster layer using the variable tmin. You will change the display by selecting a different time step.

Interpolation. Computer User Training Course Paul Dando. User Support. ECMWF 25 February 2016

Gridded data from many sources

SES 123 Global and Regional Energy Lab Procedures

5.1 Further data input

SES 123 Global and Regional Energy Lab Worksheet

Aquaplanets with slab ocean in CESM1

Prac%cal Session 3: Atmospheric Model Configura%on Op%ons. Andrew Ge>elman

Ecography. Supplementary material

I1850Clm50SpG is the short name for 1850_DATM%GSWP3v1_CLM50%SP_SICE_SOCN_MOSART_CISM2%EVOLVE_SWAV.

Day 3: Diagnostics and Output

Scientific and Validation Report for the ishai Processors of the NWC/GEO

IPSL Boot Camp Part 5:

Intro to CMIP, the WHOI CMIP5 community server, and planning for CMIP6

COMP2611: Computer Organization. Data Representation

Lecture 7. MATLAB and Numerical Analysis (4)

EcoGEnIE: A practical course in global ocean ecosystem modelling

Interpreting JULES output

Projections for use in the Merced River basin

Analysis Methods in Atmospheric and Oceanic Science

PRISM A Software Infrastructure Project for Climate Research in Europe

MODIS Atmosphere: MOD35_L2: Format & Content

An Introduction to MATLAB

Matlab stoqstoolbox for accessing in situ measurements from STOQS

Getting Started (a short tutorial):

The ncvar Package. October 8, 2004

PyNGL & PyNIO Geoscience Visualization & Data IO Modules

L2 Batch Processing script based processing of Level-2 satellite data

AMSR IDL (read_amsr_day_v5.pro): .pro. : PRO example (means this script starts here and it s name is example.pro)

SGLI Level-2 data Mati Kahru

COGS 119/219 MATLAB for Experimental Research. Fall Functions

Pangeo. A community-driven effort for Big Data geoscience

Version 3 Updated: 10 March Distributed Oceanographic Match-up Service (DOMS) User Interface Design

Metview FLEXTRA Tutorial. Meteorological Visualisation Section Operations Department ECMWF

Geographic Information System and its Application in Hydro-Meteorology Exercises using SavGIS

CHT NB-IoT UDP Message Protocol

GrADS for Beginners. Laura Mariotti

About the SPEEDY model (from Miyoshi PhD Thesis):

How Can We Use NetCDF Extractor V.2.0?

Introduction to Matlab. Summer School CEA-EDF-INRIA 2011 of Numerical Analysis

Neil Berg October 18 th, The wonderful world of NCO

1 An Introduction to GrADS Software

DWMJL. i Mrs. Rouse carried a small in- Board of T r a d e to adopt or s p o n - of Hastings.

OASIS4 User Guide. PRISM Report No 3

Scientific and Validation Report for the Clear Air Product Processor of the NWC/GEO

Ocean, Atmosphere & Climate Model Assessment for Everyone

OPeNDAP Matlab Interface Handbook Version Tom Sgouros

Writing an OPeNDAP Client Document version 1.1

Python Development Technical Note 4

Intro to Matlab for GEOL 1520: Ocean Circulation and Climate or, Notions for the Motions of the Oceans

Progress on Advanced Dynamical Cores for the Community Atmosphere Model. June 2010

Adapting Software to NetCDF's Enhanced Data Model

The netcdf- 4 data model and format. Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012

New Features of HYCOM. Alan J. Wallcraft Naval Research Laboratory. 10th HYCOM Consortium Meeting

PART I: Collecting data from National Earth Observatory

Data Processing Steps Between Observation Data, Model Data, and Live Access Server in the AOSN Program

Start > All Programs > OpenGrADS 2.0 > Grads Prompt

Spatial Ecology Lab 6: Landscape Pattern Analysis

netcdf Operators [NCO]

Page 1 of 7 E7 Spring 2009 Midterm I SID: UNIVERSITY OF CALIFORNIA, BERKELEY Department of Civil and Environmental Engineering. Practice Midterm 01

gcmfaces amatlabframeworkforthe analysis of gridded earth variables

CLM4.5 Tutorial: Running for Single- Point/ Regional Cases

Download the Latest LTR QGIS version (2.18) from the QGIS website: download.qgis.org/ >> Settings > Options > Locale

Copernicus Global Land Operations Cryosphere and Water

NCL Regridding using ESMF

Outline. Case Study. Colormaps. Announcements. Syllabus Case Study Task 1: Animation. Each frame in animation contains. field. map.

INTRODUCTION TO MATLAB

Review of Cartographic Data Types and Data Models

Library Determination of Position

OPeNDAP Aggregation Server Guide Version 1.4

Package angstroms. May 1, 2017

Lecture 2: Advanced Programming Topics

Acquiring and Processing NREL Wind Prospector Data. Steven Wallace, Old Saw Consulting, 27 Sep 2016

Sand Pit Utilization

Development of an information service system based on GOOGLE graphical interfaces. Instruction for the use of the MOON-VOS portal Interface

The AgMIP GEOSHARE: A GEOSHARE Tool for Aggregating Outputs from the AgMIP s Global Gridded Crop Modeling Initiative (Ag-GRID) User s Manual

OPeNDAP: Accessing HYCOM (and other data) remotely

How to check the location, status and usage of AnyNet Secure SIMs on AWS IoT

COM INTRO 2017: GRIB Decoding - Solutions to practicals. Solution to Practical 1: using grib_dump and grib_ls

Lab 13 SeaDAS Ocean color Processing

SWOT LAKE PRODUCT. Claire POTTIER(CNES) and P. Callahan (JPL) SWOT ADT project team J.F. Cretaux, T. Pavelsky SWOT ST Hydro leads

Analysis Methods in Atmospheric and Oceanic Science

Billing: Managing Items. Rate Increases, Description Updates, and Member Assignments

Supplementary Information for Appendix D. Richard Smith

Package cmsaf. August 6, 2018

SDK User Guide. DFS file system, PFS file system

New Features of HYCOM. Alan J. Wallcraft Naval Research Laboratory. 14th Layered Ocean Model Workshop

Transcription:

B.Aires, 20-24/02/06 - Centro de Investigaciones del Mar y la Atmosfera & Department of Atmospheric and Oceanic Sciences (UBA) DAY1 Exercise n. 1 Read an SST field in netcdf format, subsample and save in matlab format. [ 2 solutions] Exe-1_mod_1.m cd C:\ENRICO\tutorials\esercizi\day_1\ex1; Choose your work directory Use the NCBROWSER command to view nc-files content in../data directory. ncload../data/skt.mon.mean.nc Load all the content of the nc file whos Name Size Bytes Class ans 1x4 266 cell array lat 94x1 752 double array lon 192x1 1536 double array skt 687x94x192 99191808 double array time 687x1 5496 double array time is in hours since 1-1-1 00:00:0.0... diff(time)/24 Show n-days series. lat variable is N-S order >> lat(1) ans = 88.5420 >> lat(end) ans = -88.5420 select a subregion: southern ocean --> lat(end-20:end) latitude -50-90 lon(:) longitude 0 360 lat_so=lat(end-20:end); Remember: lat vector is N-S lon_so=lon; skt_so=skt(:,end-20:end,:); whos *so View your news matrices Name Size Bytes Class lat_so 21x1 168 double array lon_so 192x1 1536 double array skt_so 687x21x192 22159872 double array save./output/skt.so.mon.mean.mat lat_so lon_so skt_so Save your new matrices or save./output/skt.so.mon.mean.mat *so 1

Exe-1_mod_2.m exercise 1 cd C:\ENRICO\tutorials\esercizi\day_1\ex1; filenamein = '../data/skt.mon.mean.nc'; f = netcdf(filenamein,'nowrite'); var1= f{'skt'}; skt_so=var1(:,end-20:end,:); var2= f{'lat'}; lat_so=var2(end-20:end); var3= f{'lon'}; lon_so=var3(:); Choose your work directory Filenamein is a char array The variable f is the netcdf object. var1 is the ncvar object. whos *so View your news matrices lat_so 21x1 168 double array lon_so 192x1 1536 double array skt_so 687x21x192 22159872 double array save./output/skt.so.mon.mean.mat lat_so lon_so skt_so or save./output/skt.so.mon.mean.mat *so Save your new matrices 2

Exercise n. 2 Read an SST field, create nino3 time series and save it in binary format. Exe-2.m cd C:\ENRICO\tutorials\esercizi\day_1\ex2; ncload../data/skt.mon.mean.nc NCEP SKT dataset 01/1948-03/2004 index_lat_n3=find(-5<=lat&lat<=5); Select nino3 area: index_lon_n3=find(210<=lon&lon<=270); lat = 5S 5N lon = 210E :270E index_time=[22*12+1:22*12+30*12]; and the 1970-1999 period. lat_n3=lat(index_lat_n3); lon_n3=lon(index_lon_n3); skt_n3=skt(index_time,index_lat_n3,index_lon_n3); 360x6x33 whos skt_n3 Name Size Bytes Class skt_n3 360x6x33 1088208 double array Verify dimensions Create a 4d array: [YEARS x MONTHS x LAT x LON] skt_n3=reshape(skt_n3,12,30,6,33); skt_n3=permute(skt_n3,[2 1 3 4]); clima_skt_n3=squeeze(mean(skt_n3)); clima_skt_n3=repmat(clima_skt_n3,[30 1 1]); clima_skt_n3=reshape(clima_skt_n3,12,30,6,33); clima_skt_n3=permute(clima_skt_n3,[2 1 3 4]); ssta=skt_n3-clima_skt_n3; ssta2=reshape(ssta,30,12,6*33); ssta3=squeeze(mean(permute(ssta2,[3 1 2]))); ssta_series=reshape(ssta3',1,12*30); Simple plot... tomorrow we will plot better the same series plot(ssta_series); grid on; fid=fopen('./output/ssta_nino3_30y.dat','w','b'); 12x30x6x33 30x12x6x33 12x6x33 360x6x33 12x30x6x33 30x12x6x33 30x12x6x33 30x12x198 30x12 1x360 Save nino3 time series in binary format count=fwrite(fid,ssta_series,'float32') If count = 360, you have written correctly. fclose(fid); Close the file. 3

Exercise n. 3 Read an SST field, mask and compute global mean... esercizi\day_1\data\lsmask.19294.nc ncload../data/skt.mon.mean.nc ncload../data/lsmask.19294.nc Load skin temperature field time series and land-sea mask. pcolor(flipud(lsmask));colorbar; lsm=lsmask+1; lsm(lsm==0)=nan; skt_y1=squeeze(mean(skt(1:12,:,:))); lsmask skt sst_y1=skt_y1.*lsm; pcolor(flipud(sst_y1)); view the mask field N.B. not geo-referenced. Set "1" on the sea and "nan" on the land. 94x192 subsample the T time series in time: get the first year of mm. 94x192 94x192 View the sst field created masking the skin temperature annual field (skt_y1). N.B. not geo-referenced. 1x1 sst_global=nanmean(sst_y1(:)) sst_global = 10.1268 This is the global averaged sst value. True only considering regular grid. No weighting needed. 4

Exercise n. 4 Load monthly SST fields in structured array, mean in time and concatenate annual averages...esercizi\day_1\data\skt.25x25.????.mat list=num2str([1980:1:1989]'); Create a char array list for the years 1980-1989 for i=1:10 filenamein=strcat('../data/skt.25x25.',list(i,:),'.mat'); STRCAT Concatenate strings. varname_tmp=strcat('skt1_mm(',num2str(i),')'); string_to_eval=strcat(varname_tmp,'=load(', '''', filenamein, '''', ');') eval([string_to_eval]); EVAL Execute string with end MATLAB expression. exe: skt1_mm(1)=load('../data/skt.25x25.1980.mat') skt2_mm=squeeze(struct2cell(skt1_mm)) skt2_mm = skt3_mm=squeeze(cell2mat(skt2_mm)); STRUCT2CELL create a cell array from a struct array CELL2MAT create a double array from a cell array whos skt* skt1_mm 1x10 10162264 struct array skt2_mm 10x1 10162200 cell array skt3_mm 120x73x145 10161600 double array skt4_mm=reshape(skt3_mm,12,10,73,145); skt_y_1980_1989=squeeze(mean(skt4_mm)); save./output/skt_y_1980_1989.mat skt_y_1980_1989 12x10x73x45 10x73x145 skt annual average 5