# # Testing functionality (meeting format requirements, etc.) of basic atmospheric # scenario data. # # General test setup: reading in raw data, regridding to common p-grid (1D), # executing standard pre-RT calc internal test method atmfields_checkedCalc. # # # This case is for Jupiter and specifically tests # # (CASE A) # - from MPS/Jupiter.mean: t, z, and all abs species vmr (the ones that follow # the basename convention are caught by abs_speciesDefineAllInScenario and # AtmRawRead; others are derived manually) in the case folder AND in the # "unused/" subfolder (for the latter we have to tweak abs_species setting a # little). # (CASE B) # - from MPS/Jupiter.oval: t, z (re-using the vmr profiles from Jupiter.mean). # # - regridding to a pressure grid taken from the read-in altitude grid # - regridding to a user defined pressure grid (we chose one that is covers a # slightly larger p-range than the original data in order to test the # extrapolation and zero-padding features). # # Jana Mendrok 2013-02-26 Arts2 { INCLUDE "general/general.arts" INCLUDE "general/agendas.arts" INCLUDE "general/planet_jupiter.arts" # 1-dimensional atmosphere AtmosphereSet1D GriddedField3Create( gf3tmp ) StringCreate( caseext ) StringCreate( casefull ) StringCreate( atmcase ) ##### # CASE A ##### # set atmospheric scenario StringSet( atmcase, "planets/Jupiter/MPS/Jupiter.mean/Jupiter.mean" ) # derive abs species from scenario data abs_speciesDefineAllInScenario( basename=atmcase ) #WriteXML( "ascii", abs_species, "TestAtmScen_Jupiter_allInScen.abs_species.xml" ) # get atm scenario raw data AtmRawRead( t_field_raw, z_field_raw, vmr_field_raw, abs_species, atmcase ) # adding species or variants that do not follow the general naming convention abs_speciesAdd( species=["CH4-212"] ) Copy( casefull, atmcase ) StringSet( caseext, ".CH4-212" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["H2-12"] ) Copy( casefull, atmcase ) StringSet( caseext, ".H2-12" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["H2O"] ) Copy( casefull, atmcase ) StringSet( caseext, ".H2O_high" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["H2O"] ) Copy( casefull, atmcase ) StringSet( caseext, ".H2O_low" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["HCN"] ) Copy( casefull, atmcase ) StringSet( caseext, ".HCN_upperlim" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["NH3"] ) Copy( casefull, atmcase ) StringSet( caseext, ".NH3_high" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["NH3"] ) Copy( casefull, atmcase ) StringSet( caseext, ".NH3_low" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) #WriteXML( "ascii", abs_species, "TestAtmScen_Jupiter_allvalid.abs_species.xml" ) ##### #we also test the unused species for correct format. as these species are not # valid ARTS species, we have to assign those profile data to some other abs # species. we take N2 (but any would be ok, as long as we don't do any abs calc # with it. # reset atmospheric scenario StringSet( atmcase, "planets/Jupiter/MPS/Jupiter.mean/unused/Jupiter.mean" ) abs_speciesAdd( species=["N2"] ) Copy( casefull, atmcase ) StringSet( caseext, ".AsH3" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["N2"] ) Copy( casefull, atmcase ) StringSet( caseext, ".C6H6" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["N2"] ) Copy( casefull, atmcase ) StringSet( caseext, ".GeH4" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) abs_speciesAdd( species=["N2"] ) Copy( casefull, atmcase ) StringSet( caseext, ".H" ) Append( casefull, caseext ) ReadXML( gf3tmp, casefull ) Append( vmr_field_raw, gf3tmp ) ##### # A-1) p_grid initialized from given altitude grid ##### # we need to include negative altitudes! p_gridFromZRaw( p_grid, z_field_raw, 0 ) AtmFieldsCalc( vmr_zeropadding=1 ) Extract( z_surface, z_field, 0 ) atmfields_checkedCalc atmgeom_checkedCalc #WriteXML( "ascii", p_grid ) #WriteXML( "ascii", z_field ) #WriteXML( "ascii", t_field ) #WriteXML( "ascii", vmr_field_raw ) #WriteXML( "ascii", vmr_field ) ##### # A-2) p_grid set to a user defined grid (surely requries interpolation to calc-grid(s)) ##### VectorNLogSpace( p_grid, 401, 1020e3, 9.8e-10 ) AtmFieldsCalc( vmr_zeropadding=1 ) Extract( z_surface, z_field, 0 ) atmfields_checkedCalc atmgeom_checkedCalc #WriteXML( "ascii", p_grid ) #WriteXML( "ascii", z_field ) #WriteXML( "ascii", t_field ) #WriteXML( "ascii", vmr_field_raw ) #WriteXML( "ascii", vmr_field ) ##### # CASE B ##### #Now doing the second case folder. however, this does not include any abs # species (or vmr) data, but it does have t and z data, which we like to test. # Hence, we only replace those data and keep the raw vmr profiles from before. # As we don't read a full scenario (and don't want to overwrite the previous vrm # raw data, we ReadXML the t and z data. # set atmospheric scenario StringSet( atmcase, "planets/Jupiter/MPS/Jupiter.oval/Jupiter.oval" ) Copy( casefull, atmcase ) StringSet( caseext, ".t" ) Append( casefull, caseext ) ReadXML( t_field_raw, casefull ) Copy( casefull, atmcase ) StringSet( caseext, ".z" ) Append( casefull, caseext ) ReadXML( z_field_raw, casefull ) ##### # B-1) p_grid initialized from given altitude grid ##### # we need to include negative altitudes! p_gridFromZRaw( p_grid, z_field_raw, 0 ) AtmFieldsCalc( vmr_zeropadding=1 ) Extract( z_surface, z_field, 0 ) atmfields_checkedCalc atmgeom_checkedCalc #WriteXML( "ascii", p_grid ) #WriteXML( "ascii", z_field ) #WriteXML( "ascii", t_field ) #WriteXML( "ascii", vmr_field_raw ) #WriteXML( "ascii", vmr_field ) }