************** ALTERE OS PARAMETROS NIVEIS E EXP ******************** niveis=50 exp=KF ****************** dia=5 arqout=exp'_'niveis'N_'dia'dy' dirout='/scratchout/grupos/apgmet/home/joao.araujo/EXP/saida/MEDIA' ************** ABRA TODAS AS DATAS *********************************** 'open ../saida/2018010100/'exp'_'niveis'N_2018010100+2018010612_'dia'dy.ctl' 'open ../saida/2018010200/'exp'_'niveis'N_2018010200+2018010712_'dia'dy.ctl' 'open ../saida/2018010300/'exp'_'niveis'N_2018010300+2018010812_'dia'dy.ctl' 'open ../saida/2018010400/'exp'_'niveis'N_2018010400+2018010912_'dia'dy.ctl' 'open ../saida/2018010500/'exp'_'niveis'N_2018010500+2018011012_'dia'dy.ctl' 'open ../saida/2018010600/'exp'_'niveis'N_2018010600+2018011112_'dia'dy.ctl' 'open ../saida/2018010700/'exp'_'niveis'N_2018010700+2018011212_'dia'dy.ctl' 'open ../saida/2018010800/'exp'_'niveis'N_2018010800+2018011312_'dia'dy.ctl' 'open ../saida/2018010900/'exp'_'niveis'N_2018010900+2018011412_'dia'dy.ctl' 'open ../saida/2018011000/'exp'_'niveis'N_2018011000+2018011512_'dia'dy.ctl' 'open ../saida/2018011100/'exp'_'niveis'N_2018011100+2018011612_'dia'dy.ctl' 'open ../saida/2018011200/'exp'_'niveis'N_2018011200+2018011712_'dia'dy.ctl' 'open ../saida/2018011300/'exp'_'niveis'N_2018011300+2018011812_'dia'dy.ctl' 'open ../saida/2018011400/'exp'_'niveis'N_2018011400+2018011912_'dia'dy.ctl' 'open ../saida/2018011500/'exp'_'niveis'N_2018011500+2018012012_'dia'dy.ctl' *************** CALCULO DA MEDIA ********************************** 'set x 1 1600' 'set y 1 801' 'set gxout fwrite' 'set fwrite -be -sq 'dirout'/Media_'arqout'.bin' ****************** VARIAVEIS NÍVEIS N ******************************** **************** TEMPERATURA ***************************************** N=1 while(N<=31) 'set z 'N 'd ((tsl.1 + tsl.2 + tsl.3 + tsl.4 + tsl.5 + tsl.6 + tsl.7 + tsl.8 + tsl.9 + tsl.10 + tsl.11 + tsl.12 + tsl.13 + tsl.14 + tsl.15)/15)' N=N+1 endwhile *************** U COMP. ******************************************** N=1 while(N<=31) 'set z 'N 'd ((usp.1 + usp.2 + usp.3 + usp.4 + usp.5 + usp.6 + usp.7 + usp.8 + usp.9 + usp.10 + usp.11 + usp.12 + usp.13 + usp.14 + usp.15)/15)' N=N+1 endwhile *************** V COMP. ******************************************** N=1 while(N<=31) 'set z 'N 'd ((vsp.1 + vsp.2 + vsp.3 + vsp.4 + vsp.5 + vsp.6 + vsp.7 + vsp.8 + vsp.9 + vsp.10 + vsp.11 + vsp.12 + vsp.13 + vsp.14 + vsp.15)/15)' N=N+1 endwhile *************** UMIDADE ESPECIFICA ********************************* N=1 while(N<=31) 'set z 'N 'd ((qsl.1 + qsl.2 + qsl.3 + qsl.4 + qsl.5 + qsl.6 + qsl.7 + qsl.8 + qsl.9 + qsl.10 + qsl.11 + qsl.12 + qsl.13 + qsl.14 + qsl.15)/15)' N=N+1 endwhile *************** ALTURA GEOPOTENCIAL ******************************** N=1 while(N<=31) 'set z 'N 'd ((hgt.1 + hgt.2 + hgt.3 + hgt.4 + hgt.5 + hgt.6 + hgt.7 + hgt.8 + hgt.9 + hgt.10 + hgt.11 + hgt.12 + hgt.13 + hgt.14 + hgt.15)/15)' N=N+1 endwhile ****************** VARIAVEIS SFC *********************************** *************** PLM *********************************************** 'd ((plm.1 + plm.2 + plm.3 + plm.4 + plm.5 + plm.6 + plm.7 + plm.8 + plm.9 + plm.10 + plm.11 + plm.12 + plm.13 + plm.14 + plm.15)/15)' *************** PNMM *********************************************** 'd ((pslp.1 + pslp.2 + pslp.3 + pslp.4 + pslp.5 + pslp.6 + pslp.7 + pslp.8 + pslp.9 + pslp.10 + pslp.11 + pslp.12 + pslp.13 + pslp.14 + pslp.15)/15)' *************** TP2M *********************************************** 'd ((tshltr2.1 + tshltr2.2 + tshltr2.3 + tshltr2.4 + tshltr2.5 + tshltr2.6 + tshltr2.7 + tshltr2.8 + tshltr2.9 + tshltr2.10 + tshltr2.11 + tshltr2.12 + tshltr2.13 + tshltr2.14 + tshltr2.15)/15)' *************** PRECIPITACAO *************************************** **TOTAL** 'd ((acprec.1 + acprec.2 + acprec.3 + acprec.4 + acprec.5 + acprec.6 + acprec.7 + acprec.8 + acprec.9 + acprec.10 + acprec.11 + acprec.12 + acprec.13 + acprec.14 + acprec.15)/15)' **CONVECTIVA** 'd ((cuprec.1 + cuprec.2 + cuprec.3 + cuprec.4 + cuprec.5 + cuprec.6 + cuprec.7 + cuprec.8 + cuprec.9 + cuprec.10 + cuprec.11 + cuprec.12 + cuprec.13 + cuprec.14 + cuprec.15)/15)' **MICROFISICA** 'd ((aprec.1 + aprec.2 + aprec.3 + aprec.4 + aprec.5 + aprec.6 + aprec.7 + aprec.8 + aprec.9 + aprec.10 + aprec.11 + aprec.12 + aprec.13 + aprec.14 + aprec.15)/15)' 'disable fwrite' rc=write('template.ctl', 'DSET ^Media_'arqout'.bin') rc=write('template.ctl', 'options sequential big_endian ') rc=write('template.ctl', 'UNDEF -9999. ') rc=write('template.ctl', 'TITLE GEF output variables ') rc=write('template.ctl', 'XDEF 1600 LINEAR 0.0 0.225 ') rc=write('template.ctl', 'YDEF 801 LINEAR -90.00 0.225 ') rc=write('template.ctl', 'ZDEF 31 LEVELS 1 2 3 5 7 10 20 30 50 70 100 150 200 250 300 350 400 450 500 550 600 650 700 750 800 850 900 925 950 975 1000 ') rc=write('template.ctl', 'TDEF 1 LINEAR 00Z01Jan2018 1hr ') rc=write('template.ctl', 'VARS 11 ') rc=write('template.ctl', 'tsl 31 99 TEMPERATURE [K] ') rc=write('template.ctl', 'usp 31 99 U COMP. VEL./ZONAL WIND [m/s] ') rc=write('template.ctl', 'vsp 31 99 V COMP. VEL./MERIDIONAL WIND [m/s] ') rc=write('template.ctl', 'qsl 31 99 SPEC. HUMIDITY [kg/kg] ') rc=write('template.ctl', 'hgt 31 99 GEOPOTENTIAL HEIGHT [gpm] ') rc=write('template.ctl', 'plm 0 99 SURFACE PRESSURE [hPa] ') rc=write('template.ctl', 'pslp 0 99 SEA LEVEL PRESSURE [hPa] ') rc=write('template.ctl', 'tshltr2 0 99 2m TEMPERATURE [K] ') rc=write('template.ctl', 'acprec 0 99 ACCUMULATED TOTAL PRECIPITATION [m] ') rc=write('template.ctl', 'cuprec 0 99 ACCUMULATED CONVECTIVE PRECIPITATION [m] ') rc=write('template.ctl', 'aprec 0 99 ACCUMULATED GRID-SCALE PRECIPITATION [m] ') rc=write('template.ctl', 'ENDVARS ') '!mv template.ctl 'dirout'/Media_'arqout'.ctl' 'quit'