To read multiple arrays in a loop

From: Noel Aloysius <noel.aloysius_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 24 2013 - 11:30:04 MST

Hello NCL,

I have a list of arrays, dimensioned (/24,1800,47,47/) == (/ensembles,
time, lat, lon/), as follows,

  var_arr = (/"sim_pr","sim_pet","sim_et","sim_swi","sim_swe","sim_perc", \

"sim_gwrchg","sim_darchg","sim_revap","sim_sast","sim_surqgen", \

"sim_surqcnt","sim_tloss","sim_latq","sim_gwq","sim_wyld","sim_cn"/) ;
list of 17 arrays

I defined a new array to store monthly climatology of each variable listed
in var_arr as follows,

sim_clim = new ((/24,17,12,nlat,nlon/),"float",1e+20) ; where array size
(/24,17,12,nlat,nlon/) == (/ensembles, variable, months, nlat, nlon/)

I want to compute the climatologies with a loop as follows,

  do i=0,23 ; loop through ensembles
    do j=0,16 ; loop through variables

      P1 = var_arr(j) ; I can't point to an array this way, but
want to know how I can point to the correct array listed in var_arr
      sim_clim(i,j,:,:,:) = (/ clmMonTLL(P1(i,{197101:200012},:,:) /)

    end do
  end do

I would like to know how I can point the correct array from the list
var_arr and pass it to P1.


ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Jan 24 11:30:15 2013

This archive was generated by hypermail 2.1.8 : Tue Jan 29 2013 - 22:44:26 MST