################################################################################ # # # 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 cloud # # data for Mars as specified by the user. For user specification use, e.g., # # DemoMarsClouds1D.arts 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 clouds_mars.arts # # (hence, clouds_mars.arts needs to be included before the file at hand). # # # # This file expects the following input parameters: # # dustcase (ArrayOfIndex) Selected dust scenario(s). # # co2case (ArrayOfIndex) Selected CO2 ice cloud scenario(s). # # h2ocase (ArrayOfIndex) Selected H2O ice cloud scenario(s). # # dustRI (Index) Refractive index setup for Martian dust. # # co2RI (Index) Refractive index setup for CO2 ice. # # h2oRI (Index) Refractive index setup for H2O ice. # # # # Files to be included before this file: # # includes/mars/clouds_mars.arts # # includes/common/createvars.arts # # # # It provides no direct output, but stores the output in temporary files # # (which will the be processed into their final variable containers by # # makeclouds1D.arts). This externally stored output is: # # pnd_field_raw as the WSV # # ssdfiles (ArrayOfString) List of files containing the single # # scattering data for each particle type. # # The list serves as input parameter # # scat_data_files to WSM # # ScatSpeciesPndAndScatAdd. # # Names of the temporary files are passed into makeclouds1D.arts by the String # # variables # # pndtmp for pnd_field_raw file # # poptmp for ssdfiles # # # ################################################################################ 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( pndtmp, "tmp1.xml" ) StringSet( poptmp, "tmp2.xml" ) IndexCreate( RIcase ) ArrayOfIndexCreate( cloudcase ) ArrayOfIndexCreate( cloudcasearray ) # Loop agenda to get pnd & ssd data of all modes in a cloud layer AgendaCreate( caseloop_agenda ) AgendaSet( caseloop_agenda ){ ReadXML( out=pnd_field_raw, filename=pndtmp ) ReadXML( out=ssdfiles, filename=poptmp ) Extract( itmp, cloudcase, forloop_index ) Extract( itmp, cloudcasearray, itmp ) Extract( strtmp, cloudtypearray, itmp ) Append( pndstr, strtmp ) Append( ssdstr, strtmp ) Extract( strtmp, cloudprofilearray, itmp ) Append( pndstr, strtmp ) Extract( strtmp, RIarray, RIcase ) Append( ssdstr, strtmp ) Print( pndstr, 0 ) ReadXML( aogf3tmp, pndstr ) Append( pnd_field_raw, aogf3tmp ) WriteXML( output_file_format=tmpformat, in=pnd_field_raw, filename=pndtmp ) Print( ssdstr, 0 ) Append( ssdfiles, ssdstr ) WriteXML( output_file_format=tmpformat, in=ssdfiles, filename=poptmp ) } # Get the cloud pnd field and single scattering data # --- # first, create the casename string down to the common filename part in the # scenario folder. Data is located in: # Mars.atmo/ # base name for pndfields Copy( pndstr, cloudbase ) # construct upper level path name (Mars.Ls.daytime.dust) StringSet( atmostr, "Mars" ) StringSet( strtmp, "." ) Append( atmostr, strtmp ) Extract( subatmo, Lsarray, Ls ) Append( atmostr, subatmo ) Append( atmostr, strtmp ) Extract( subatmo, daytimearray, daytime ) Append( atmostr, subatmo ) Append( atmostr, strtmp ) Extract( subatmo, dustarray, dust ) Append( atmostr, subatmo ) # append upper level path name (Mars.Ls.daytime.dust) to base path Append( pndstr, atmostr ) StringSet( strtmp, "/" ) Append( pndstr, strtmp ) # append base file name (Mars.Ls.daytime.dust.) to path construction Append( pndstr, atmostr ) StringSet( strtmp, "." ) Append( pndstr, strtmp ) # append pndfield marker Append( pndstr, pndprename ) # base name for scatdata Copy( ssdstr, cloudbase ) Append( ssdstr, ssdprename ) StringSet( infostr, "Cloud profile data (pnd_field) taken from: " ) Append( infostr, pndstr ) StringSet( strtmp, "*" ) Append( infostr, strtmp ) Print( infostr ) # now, we construct the name for the specific data files one-by-one, read the # pnd field data and construct pnd_field_raw (array of pnd fields), and store # the ssd file names as array in a file. This in order to later use # ScatSpeciesPndAndScatAdd to actually get the respective data into the pnd_field_raw # and scat_data ARTS WSV. Compared to directly putting the individual pnd # field and single scattering data array entries into the WSV one-by-one, this # is advantageous as (1) we do not need to read & write the scat_data # over and over to get the data out of the ForLoop (saves time) and (2) # some basic checks (covering f_grid, correct atmospheric dimension) will be # performed on scat_data and pnd_field_raw. # second, we need to initialize the containers for the pndfield and scatdata Touch( pnd_field_raw ) Touch( ssdfiles ) WriteXML( output_file_format=tmpformat, in=pnd_field_raw, filename=pndtmp ) WriteXML( output_file_format=tmpformat, in=ssdfiles, filename=poptmp ) # third, we loop over the included cloud layers/cloud types. separately per # (super)cloud type. no check done, whether indeed only one scenario per # (super)cloud type is defined. it's running, if more are defined, but the # constructed case doesn't make sense then. # first, the dust Copy( cloudcase, dustcase ) Copy( cloudcasearray, dusttypes ) Copy( RIcase, dustRI ) nelemGet( ncases, cloudcase ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, caseloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) # then, the co2 ice Copy( cloudcase, co2case ) Copy( cloudcasearray, co2types ) Copy( RIcase, co2RI ) nelemGet( ncases, cloudcase ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, caseloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) # eventually, the h2o ice Copy( cloudcase, h2ocase ) Copy( cloudcasearray, h2otypes ) Copy( RIcase, h2oRI ) nelemGet( ncases, cloudcase ) IndexStepDown( ncases, ncases ) Copy( forloop_agenda, caseloop_agenda ) ForLoop( forloop_agenda, 0, ncases, 1 ) # all the rest is now done by makeclouds*.arts }