Making ATMOSPH.IN File Larger

A discussion forum for Hydrus-1D users.
Post Reply
crhansen
Posts: 21
Joined: Thu Dec 03, 2015 4:21 pm
Location: Canada

Making ATMOSPH.IN File Larger

Post by crhansen » Sun Sep 16, 2018 9:27 pm

I am trying to run HYDRUS-1D with 35,000 rows of P and PET data, but this means I have to manually edit the ATMOSPH.IN file. I have read the FAQ on this topic, which says I should use Notepad or similar program to edit the ATMOSPH.IN file. I fully understand that part and am comfortable using Notepad. But my original P and PET data are in MS-Excel, and when I try to copy and paste from MS-EXCEL into the ATMOSPH.IN file (which is open in Notepad), the new data does not line up with the data already in the file. I can't see how to force the data coming from Excel to match the pre-existing format text / data format in ATMOSPH.IN. Has anyone else had this problem ? Is there another text editor which might be better than Notepad ? So far, I have tried using Notepad and Wordpad, and used "Paste Special" to force Excel to copy in as text only, but still can't get it right.

CH

crhansen
Posts: 21
Joined: Thu Dec 03, 2015 4:21 pm
Location: Canada

Re: Making ATMOSPH.IN File Larger

Post by crhansen » Sun Sep 16, 2018 10:32 pm

I tried again and this time I made the edits in MS-EXCEL, saved the file as a .txt, cleaned up the headers and footers, and re-named the file as ATMOSPH.IN. HYDRUS-1D executed successfully with the updated file with 35064 rows of data. So sorry but please disregard my post (problem solved).

CH

Jirka
Posts: 4716
Joined: Sat Mar 16, 2002 3:47 pm
Location: USA
Location: Riverside, CA

Re: Making ATMOSPH.IN File Larger

Post by Jirka » Tue Sep 25, 2018 7:38 am

Thanks for letting us know that you resolved the problem. That is appreciated. Very few people inform us about positive outcomes (only about the negative ones). J.

paolino80
Posts: 1
Joined: Fri Sep 11, 2015 2:25 pm
Location: Italy

Re: Making ATMOSPH.IN File Larger

Post by paolino80 » Wed May 29, 2019 12:45 pm

Hi

I use this MATLAB script to build the file ATMOSPH.IN with several rows of daily P, Ep and Tp:


c1=[1:ly]'; % max number of rows

c2=input(:,1); % net Precipitation
c3=input(:,2); % rSoil, pot evaporation
c4=input(:,4); % rRoot, pot transpiration
c5=(100000)*ones(ly,1);% hCritA
c6=zeros(ly,1); % rB
c7=zeros(ly,1); % hB
c8=zeros(ly,1); % ht

ATM_INPUTmod=[c1 c2 c3 c4 c5 c6 c7 c8]; % I build the matrix to set up the file ATMOSPH.IN

a=fopen('original_ATM.IN','r'); % I read the original file of ATMOSPH.IN
b=fopen('ATMOSPH.IN','w');
i=1; %check that in line 4 the number is laET=length(c1)!!!!!
while 1;
s= fgetl(a);
if ~ischar(s), break,end
if feof(a) , break,end

if i<10
fprintf(b,'%s\r\n',s);
else

fprintf(b,'%11.0f %11.5f %11.5f %11.5f %11g %11g %11g %11g\r\n',ATM_INPUTmod');
fprintf(b,'end*** END OF INPUT FILE ''ATMOSPH.IN'' *************************************\r\n');
break
end
i=i+1;
end

fclose (a);
fclose (b);

Post Reply