New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
getname.pro in trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts – NEMO

source: trunk/NEMOGCM/CONFIG/ORCA2_LIM/IDL_scripts/getname.pro @ 2709

Last change on this file since 2709 was 2709, checked in by flavoni, 13 years ago

update idl scripts, see ticket 724

File size: 565 bytes
Line 
1function getname,dir,exp,freq,suff,date
2 
3 file_list = file_search (dir+'/'+exp+'_*_*_'+freq+'_'+suff+'.nc', count = nb_file )
4 
5 file_list = file_basename( file_list )
6
7 filename = ''
8 i = 0
9
10 while  i lt nb_file  and filename eq '' do begin
11 
12    split_name = STRSPLIT(file_list[i],'_',/EXTRACT )
13    date1 = long(split_name[1])
14    date2 = long(split_name[2])
15
16
17    if date1 - date le 0 and  date - date2 le 0 then filename = dir+'/'+file_list[i]
18    i = i + 1
19   
20 endwhile
21
22 if filename eq '' then print,'filename does NOT FOUND'
23
24 return,filename
25
26end
Note: See TracBrowser for help on using the repository browser.