;************************************************* ; CSM Graphics: Norme MARS (R.P. :19052004) ;************************************************ load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" ;*********************************************************** ;***Variables fichier Mars*************** ;(0) V ;(1) U ;(2) XE ;(3) HO ;(4) z ;(5) time ;(6) longitude ;(7) latitude ;********************************************* ;********************************************************** begin ;****************************************************************** ; Espace utilisateurs ;****************************************************************** reper_fichier = "../raw/" nom_fichier = "tdc_sete_2010-01-13_wgs84.txt" nom_fichier_out = "tdc_sete_2010-01-13_wgs84.nc" ncol = 3 nrow = 1120 temp=asciiread(reper_fichier+nom_fichier,(/nrow,ncol/),"float") profil_val=new((/nrow/),float) longitude=new((/nrow/),float) latitude=new((/nrow/),float) time=new((/nrow/),float) temp@units="m" temp@location="Lido of Sete in FRANCE" temp@activity="Coastline measurements" do n = 0,nrow-1 profil_val(n)=-sqrt(temp(n,0)*temp(n,0)+temp(n,1)*temp(n,1))+sqrt(temp(0,0)*temp(0,0)+temp(0,1)*temp(0,1)) longitude(n)=temp(n,1) latitude(n)=temp(n,0) time(n)=temp(n,2) end do longitude!0="lon" longitude@name="longitude" longitude@units="degrees_east" longitude@coordinates="WGS84" latitude!0="lat" latitude@name="latitude" latitude@units="degrees_north" latitude@coordinates="WGS84" time!0="time" time@name="time" time@units="date in YYYYMMDD.HHMMSS" profil_val@units="m" profil_val@long_name="distance to coast" fich_out=reper_fichier+nom_fichier_out system("/bin/rm -f "+fich_out) ;**suppression s'il existe deja ncdf_out = addfile(fich_out, "c") dimNames = (/"profil_val"/) dimSizes = (/nrow/) dimUnlim = (/False/) filedimdef (ncdf_out, dimNames , dimSizes, dimUnlim) filevardef (ncdf_out, "latitude", typeof(latitude), "profil_val") filevarattdef(ncdf_out, "latitude", latitude) filevardef (ncdf_out, "longitude", typeof(longitude), "profil_val") filevarattdef(ncdf_out, "longitude", longitude) filevardef (ncdf_out, "time" , typeof(time), "profil_val") filevarattdef(ncdf_out, "time", time) ;****** ncdf_out->latitude = (/latitude/) ncdf_out->longitude = (/longitude/) ncdf_out->time = (/time/) end