################################################################################ # # # Unless further variables or options for existing variables are introduced, # # DO NOT MODIFY this file! This is only a helper file! # # # ################################################################################ # # # This file does the actual work of selecting and reading in the RAW # # wind data for Venus as specified by the user. For user specification use, # # e.g., DemoVenusAtmo3D.arts (or its 1D equivalent) as template. The template # # also contains the detailed information on which indices are linked to which # # specific value/selection for each of the variables. The full arrays, which # # the indices refer to and from which the actual values are extracted, are # # defined in atmo_venus.arts (hence, atmo_venus.arts needs to be included # # before the file at hand). # # # # This file expects the following input parameters: # # atmo (Index) The atmospheric scenario. # # NSwind (ArrayOfIndex) N-S wind setup selected. # # EWwind (ArrayOfIndex) E-W wind setup selected. # # # # Files to be included before this file: # # includes/mars/atmo_venus.arts # # includes/common/createvars.arts # # # # It provides following output: # # wind_u_raw (GriddedField3) raw version of wind_u_field # # wind_v_raw (GriddedField3) raw version of wind_v_field # # # ################################################################################ Arts2 { # We will need to dummy-store some data in files to be able to export data from # forloops. So we create some dummy names. #StringSet( tmpformat, "ascii" ) StringSet( tmpformat, "binary" ) StringSet( Btmp, "tmp1.xml" ) # Create a dummy file with empty wind data (because regardless of whether there # actually IS data, we are going to read the storage dummy at least once. so we # need to create an empty version first.) Touch( gf3tmp ) #this in case gf3tmp hasn't been used before Delete( gf3tmp ) #this to throw away possible data in gf3tmp (if it was used before) Touch( gf3tmp ) #this to initialize it again after deleting # this to have a properly formated file to read after the forloops WriteXML( output_file_format=tmpformat, in=gf3tmp, filename=Btmp ) # Get data for one wind component AgendaCreate( windloop_agenda ) AgendaSet( windloop_agenda ){ Extract( strtmp, casearray, forloop_index ) Append( specfilename, strtmp ) # Print( specfilename, 0 ) ReadXML( gf3tmp, specfilename ) WriteXML( output_file_format=tmpformat, in=gf3tmp, filename=Btmp ) } # Read the wind raw data # --- # first, create the casename string down to the common filename part in the # scenario folder. Data is located in: # Venus.atmo/ Copy( atmostr, atmobase ) Extract( subatmo, atmoarray, atmo ) Append( atmostr, subatmo ) StringSet( strtmp, "/" ) Append( atmostr, strtmp ) Append( atmostr, subatmo ) StringSet( strtmp, "." ) Append( atmostr, strtmp ) # now we obtain the wind components one-by-one # (1) N-S Winds Copy( specfilename, atmostr ) Select( casearray, NSwindarray, NSwind ) nelemGet( ncases, casearray ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, windloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) ReadXML( out=wind_v_raw, filename=Btmp ) # (2) E-W Winds Copy( specfilename, atmostr ) Select( casearray, EWwindarray, EWwind ) nelemGet( ncases, casearray ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, windloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) ReadXML( out=wind_u_raw, filename=Btmp ) # and we clean up the dummy files (not completely, though. but we write an empty # variable into them.) Delete( strtmp ) Touch( strtmp ) WriteXML( output_file_format=tmpformat, in=strtmp, filename=Btmp ) }